LLM Local Assistant - VS Code ExtensionLocal AI Code Orchestrator - Multi-step planning, architecture validation, RAG-powered codebase context, and Zustand/React Hook auditing. 2,872 tests. All running on your local LLM with zero cloud dependencies. 🚀 v2.15.0: Pipeline Correctness — planner filters, architecture validator, and auto-correction hardened
📚 Release HistoryFor a complete history of releases and detailed changelogs, see CHANGELOG.md. Recent Releases:
✨ Key Features & Capabilities (v2.14.0)🏛️ Architecture & Validation System6-Check Sequential Validation
Code Analysis
📝 Code Generation & AnalysisMulti-Step Planning with Validation
File Operations with Confidence
🔍 RAG Codebase ContextEmbedding-Powered Import Resolution
📊 Git Integration & Code ReviewAI-Powered Git Operations
🔐 Quality & Testing InfrastructureAutomated Quality Assurance
🚀 Quick Start (30 seconds)1. Start Local LLM Server
2. Install Extension
3. Test It
4. Analyze Your Code
📋 Command ReferenceMulti-Step Code Generation (v2.5.0+ - VALIDATED & RELIABLE)
|
| Setting | Default | Description |
|---|---|---|
llm-assistant.endpoint |
http://localhost:11434 |
LLM server URL |
llm-assistant.model |
mistral |
Model name to use |
llm-assistant.temperature |
0.7 |
Response randomness (0-1) |
llm-assistant.maxTokens |
4096 |
Max response length |
llm-assistant.timeout |
60000 |
Request timeout (ms) |
LLM Server Setup
Ollama (Recommended)
# Install: https://ollama.ai
# Run model server:
ollama run mistral
# Server: http://localhost:11434
LM Studio
1. Download: https://lmstudio.ai
2. Open app → Select model → Click "Start Local Server"
3. Server: http://localhost:8000
4. In VS Code settings, set endpoint to: http://localhost:8000
vLLM
python -m vllm.entrypoints.openai.api_server \
--model mistral-7b-instruct-v0.2 \
--port 11434
Recommended Models
| Model | Rating | Notes |
|---|---|---|
mistral |
⭐⭐⭐⭐⭐ | Best all-around (recommended) |
qwen2.5-coder |
⭐⭐⭐⭐⭐ | Best for code analysis |
llama2-uncensored |
⭐⭐⭐⭐ | Good general analysis |
neural-chat |
⭐⭐⭐⭐ | Fast, decent quality |
Architecture Rules (Optional Quality Enforcement)
The extension is fully customizable and does not enforce quality by default. You decide whether to enable pattern validation.
How It Works
- No rules: Extension works normally, LLM generates code without validation
- With rules: Extension validates generated code against your custom patterns
- Opt-in: You control what gets validated and when
Using Architecture Rules
Step 1: View Example Rules
The extension includes example rules in: examples/.lla-rules
View this file to see available patterns (forms, components, state management, etc.)
Step 2: Copy to Your Workspace
# Copy the example rules to your workspace root:
cp examples/.lla-rules /path/to/your/workspace/.lla-rules
Step 3: Customize for Your Project
Edit .lla-rules in your workspace root to define:
- Form component patterns (7 required patterns)
- Component architecture rules
- API design standards
- Validation requirements
- Code style guidelines
Step 4: Enable Validation
Once .lla-rules exists in your workspace, the extension automatically:
- Injects rules into LLM context during code generation
- Validates generated code against your patterns
- Rejects code that violates rules
- Asks LLM to regenerate with compliance
Example: Form Component Validation
If you include the "Form Component Architecture" section in .lla-rules, the extension will enforce these 7 patterns:
- State Interface -
interface LoginFormState {} - Handler Typing -
FormEventHandler<HTMLFormElement> - Consolidator Pattern - Single
handleChangefunction - Submit Handler -
onSubmiton<form>element - Zod Validation - Schema-based validation
- Error State Tracking - Field-level errors
- Semantic Markup - Proper HTML form elements
No .lla-rules file? Extension works fine without it - just no pattern validation.
For More Details
See docs/patterns/FORM_COMPONENT_PATTERNS.md for detailed explanation of each pattern and why they matter.
🔒 Privacy & Security
✅ 100% Local & Private
- No external APIs
- No cloud services
- No telemetry
- No internet required
- Your code stays on your machine
How it works:
- Your LLM runs locally (Ollama, LM Studio, vLLM)
- Extension sends requests to local server only
- All processing happens locally
- Responses processed in VS Code
- Nothing leaves your machine
🏗️ Architecture & Design
/plan <task>
│
▼
[PLANNER] ──── LLM call: natural language → PlanStep[]
│ Post-processed: inject missing deliverables,
│ topological sort by dependency
│
▼
[ARCHITECT] ── Per-file: generate 3-5 YES/NO acceptance criteria
│ Injected into generator AND used by reviewer
│ File-type guards prevent nonsensical criteria
│ (e.g. no "uses cn()" criterion for a .ts config file)
│
▼
[GENERATOR] ── Conditional constraint injection by file type:
│ hooks → no JSX / return contract rules
│ stores → flat state / no React imports
│ .ts data files → absolutely no JSX
│ structural layouts → copy all visual sections
│ interactive components → forwardRef required
│
▼
[VALIDATOR] ── 6 sequential checks (1-5 pre-write, 6 post-write):
│ 1. Syntax — brace balance, markdown-in-code, any types
│ 2. Patterns — bare classNames, JSX in .ts, missing padding
│ 3. Hook usage — called? destructured? mixed state?
│ 4. Cross-file contract — imported symbols exist in source
│ 5. LLM reviewer — structured YES/NO vs acceptance criteria
│ ── file written to disk ──
│ 6. tsc --noEmit — ground-truth compiler errors for this file
│
▼
[CORRECTOR] ── Two layers before giving up:
│ A. Deterministic (SmartAutoCorrection):
│ merge split React imports, remove cn from .ts files,
│ fix circular imports, template-literal→ternary in style objects
│ B. LLM correction: targeted error list + file-specific
│ instructions (e.g. "REMOVE ALL JSX" for .ts files,
│ not the default "keep existing JSX structure")
│ Loop detector: aborts if same error repeats twice
│
▼
Your Files
Design Principle: Push Decisions Left
Every constraint that can be expressed as a regex belongs in the validator, not the generator. Every constraint that can be deterministically fixed belongs in SmartAutoCorrection, not the LLM corrector. The LLM corrector is a last resort — it consumes context, produces non-deterministic output, and can introduce new errors while fixing old ones.
The failure modes this architecture is designed to prevent:
| Failure | Where it's caught | How |
|---|---|---|
| LLM imports hallucinated packages | Generator | availablePackagesSection injects exact package.json deps |
JSX generated in a .ts config file |
Generator + Validator | configTsConstraintSection + extension check |
| Sibling component imports sibling | Generator | createdFilesSection sibling rule + example |
| Wrong step order (Layout before Routes) | Planner post-processor | Topological sort on description patterns |
Ghost symbol imports (@/types/config) |
Validator Check 4 | Cross-file contract reads actual exports from disk |
| Corrector loops on unfixable error | Corrector | Loop detector + unfixablePatterns early exit |
| Architecture violation silently allowed | ArchitectureValidator | High-severity violations always produce 'skip' regardless of strict mode |
| Planner drops legitimate run/verify steps | Planner | Narrowed isManualStep and isRedundantTestStep guards to exact patterns |
A longer prompt is always cheaper than a failed correction attempt. One hallucinated import triggers up to 9 correction calls (3 inner × 3 outer retries), each consuming context and producing a shorter, degraded file. Preventing the hallucination at generation time with an extra instruction line costs nothing.
✅ Quality & Testing
- 2,872 tests — 78 test files, 100% pass rate ✅
- TypeScript strict mode — 0 compilation errors
- CI/CD — Automatic quality checks on every PR
npm test # Run all tests
npm run coverage # Run with coverage report
⚠️ Limitations & Agentic Boundaries
Cross-File Contract Drift
Current Limitation: Multi-file Refactoring
V3.0 implements strict per-file governance. However, in complex refactors involving Zustand stores and consumers, the system may encounter Contract Drift where the component's expected interface mismatches the store's generated exports.
What is Contract Drift?
When the LLM generates multiple files in sequence, each file is validated independently. However, between files, the interface contract can drift:
// Step 1: Store created with interface
export const useLoginStore = create<LoginFormStore>((set) => ({
formData: { email: '', password: '' },
errors: {},
setFormData: (data) => set({ formData: data }),
setErrors: (errors) => set({ errors }),
})) // 4 exports
// Step 2: Component generated, expects DIFFERENT interface
const { formData, errors, setFormData, setErrors, submitForm } = useLoginStore();
// ❌ 5th export (submitForm) doesn't exist!
Why it happens:
- File-level validation: Each file is validated in isolation
- No persistent contract tracking: Once Store file is written, component generation starts fresh
- LLM context window: By the time component is generated, LLM may have forgotten exact store interface
- State evolution: LLM might imagine properties the store doesn't actually export
How it's detected:
- ✅ Store property extraction via regex parsing of TypeScript generics
- ✅ Component destructuring pattern matching
- ✅ Cross-file property validation (component properties must exist in store)
- ✅ Detailed error messages showing actual vs expected
Workaround:
- Generate store first - Use
/writeor/planto createuseLoginStore.ts - Verify store exports - Open the file, confirm properties match your design
- Generate component second - The executor passes store content as context to downstream steps
- Validate alignment - Check component destructuring matches store exactly
- Run tests - TypeScript compiler catches mismatches immediately
The system will catch contract drift during validation and prevent broken code from being written — but it cannot prevent the LLM from imagining properties that don't exist. Trust your eyes more than the AI for this pattern.
🚀 Development
Build
npm run compile # Single build
npm run watch # Auto-rebuild on changes
npm run package # Production VSIX package
Test
npm test # Run all tests
npm run test:watch # Auto-run on changes
Debug
# Press F5 in VS Code to start debug session
# Then test commands in chat window
📚 Documentation
Industry Standard (Root)
- CHANGELOG.md - Version history and releases
- ROADMAP.md - Future development plans
- LICENSE - MIT License
Core Documentation (/docs/)
- ARCHITECTURE.md - System design
- Installation Guide - Setup instructions
- Contributing - Development guidelines
- Project Status - Current status and roadmap
- Marketplace Info - VS Code Marketplace publishing guide
Patterns (/docs/patterns/)
- Form Component Patterns - 7 form component patterns (rules in
.lla-rules) - Architecture Patterns - Architecture rules integration
🐛 Troubleshooting
LLM Server Issues
"Cannot connect to endpoint"
- Make sure LLM server is running
- Check endpoint URL in settings
- Test with
/check-modelcommand
"Model not found"
- List models:
ollama list - Download:
ollama pull mistral - Update settings with correct model name
"Request timeout"
- Increase timeout in settings (default 60000ms)
- Check server resources (CPU, RAM)
- Try smaller model
📝 License
MIT License - See LICENSE for details.
v2.15.0 — Local AI Code Orchestrator | 🧪 2,872 Tests Passing | 📦 79KB Install | 🔒 100% Private | Zero-Telemetry
Created by @odanree