Developers working under strict intellectual property policies, enterprise NDA constraints, or air-gapped environments cannot upload proprietary source code to cloud vector databases. While commercial coding assistants routinely transmit codebase snippets to managed cloud embeddings, the open-source assistant Continue provides a fully self-hosted, local-first alternative inside Visual Studio Code.
At 365Finds, our research verdict is straightforward: For true private repository-wide retrieval, bypass the zero-config built-in default and deploy Continue with a dedicated local Ollama instance running nomic-embed-text. While Continue's bundled Transformers.js engine provides an immediate out-of-the-box experience, its restrictive token context window frequently truncates dense multi-line classes and structural abstractions. Pairing Continue with an 8,192-token local embedding model backed by its native LanceDB vector store strikes the ideal balance between absolute privacy and dependable semantic retrieval.
How Continue Indexes Your Codebase Privately
Continue avoids external vector databases (such as remote Milvus, Pinecone, or Qdrant clusters) by using an embedded architecture directly on your local workstation. Understanding how the indexing pipeline processes your code helps prevent indexing bottlenecks:
- AST-Aware Code Chunking: Continue scans your workspace and utilizes Tree-sitter to break files down along logical syntactic boundaries (classes, functions, and interface declarations) rather than slicing code at arbitrary line or character counts.
- Local Vectorization: Each chunk is dispatched to your configured local embedding provider (either embedded Transformers.js inside the extension host or a local Ollama endpoint).
- Embedded LanceDB Storage: Embeddings, chunk hashes, and file references are saved directly onto your local disk within
~/.continue/index/(on Windows:%USERPROFILE%\.continue\index\). LanceDB uses Apache Arrow-backed columnar storage, enabling rapid disk-based vector search without running an independent database daemon. - Incremental SQLite Cache: A companion SQLite database (
index.sqlite) tracks file modification times and Git commit hashes. When files change, Continue re-indexes only altered files instead of reprocessing the entire repository.
Hardware Requirement Note: LanceDB's underlying native modules on x64 Linux distributions require AVX2 and FMA CPU instruction sets. On older server hardware lacking AVX2, codebase indexing will automatically disable itself, although standard model chat and autocomplete will continue to function.
Step-by-Step Configuration Guide
Configuring private codebase retrieval involves two core components: pointing Continue to your local embedding model and instructing the indexer on which files to digest.
Step 1: Set Up the Local Embedding Provider
Recommended Path: Ollama with nomic-embed-text
Ollama provides local GPU/Metal acceleration and handles 768-dimensional vectors with an 8,192-token context window.
- Install Ollama and pull the embedding model:
ollama pull nomic-embed-text - Ensure the Ollama background daemon is running:
By default, it listens atollama servehttp://localhost:11434.
Fallback Path: Built-in Transformers.js
If you are running in a locked-down workstation where installing Ollama is prohibited, Continue includes Transformers.js running all-MiniLM-L6-v2 (384 dimensions, ~256/512 token context) inside VS Code via ONNX Runtime without external dependencies.
Step 2: Configure Continue (config.json and config.yaml)
Depending on your Continue version, edit your global configuration file located at ~/.continue/config.json or ~/.continue/config.yaml (accessible via the gear icon at the bottom of the Continue sidebar).
Configuration via config.json (Continue v0.8.x)
{
"models": [
{
"title": "Local Qwen 2.5 Coder 7B",
"provider": "ollama",
"model": "qwen2.5-coder:7b"
}
],
"embeddingsProvider": {
"provider": "ollama",
"model": "nomic-embed-text",
"apiBase": "http://localhost:11434"
},
"contextProviders": [
{
"name": "codebase",
"params": {
"nRetrieve": 30,
"nFinal": 5,
"useReranking": false
}
}
]
}
If using the built-in Transformers.js instead, set:
"embeddingsProvider": {
"provider": "transformers.js"
}
Modern Equivalent via config.yaml (Continue v1.0+)
models:
- name: Local Qwen 2.5 Coder
provider: ollama
model: qwen2.5-coder:7b
roles:
- chat
- edit
- name: Local Nomic Embed
provider: ollama
model: nomic-embed-text
apiBase: http://localhost:11434
roles:
- embed
context:
- provider: codebase
params:
nRetrieve: 30
nFinal: 5
useReranking: false
Step 3: Configure .continueignore to Protect Index Health
Failing to configure ignore rules is the primary cause of indexing freezes, out-of-memory errors, and bloated vector databases. While Continue automatically respects .gitignore, production codebases contain numerous non-code artifacts and massive generated files that pollute semantic recall.
Create a .continueignore file in the root directory of your project (or globally in ~/.continue/.continueignore):
# Dependency lockfiles and manifests
package-lock.json
pnpm-lock.yaml
yarn.lock
Cargo.lock
poetry.lock
Pipfile.lock
# Build artifacts and bundling outputs
dist/
build/
out/
.next/
.nuxt/
target/
*.min.js
*.min.css
*.map
# Test fixtures, dumps, and media
tests/fixtures/
*.csv
*.tsv
*.sql
*.sqlite
*.log
*.svg
*.png
*.jpg
# Environment secrets and credentials
.env
.env.*
*.pem
*.key
*.cert
Step 4: Fine-Tuning Retrieval Parameters
In the codebase context provider block, three parameters determine search precision and system responsiveness:
nRetrieve(Default: 25-30): The number of initial chunk candidates fetched from LanceDB using approximate nearest neighbor vector distance. For repositories over 100,000 lines, 30 candidates ensure adequate structural breadth.nFinal(Default: 5): The final number of retrieved chunks inserted into the prompt context sent to your chat model. Setting this above 8 when using local 7B or 14B models risks context dilution and degrades generation speed.useReranking(Default:falsefor local setups): When set totrue, Continue performs a second-pass relevance filtering. On local-only workstations without a high-speed dedicated re-ranking model (such as a local BGE-Reranker), leave this set tofalse. Running re-ranking through standard local LLMs introduces noticeable conversational latency.
Step 5: Triggering and Validating Codebase Indexing
- Trigger Indexing: Open the VS Code Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) and execute:Continue: Codebase Force Re-Index - Observe Progress: Look at the small circular status icon in the bottom status bar or inside the Continue sidebar. Initial indexing processes your files sequentially through Ollama.
- Query via
@codebase: In the Continue chat panel, type@codebasefollowed by your question:
Continue will retrieve the top matching chunks from local LanceDB, display the referenced files above the response, and synthesize the answer completely offline.@codebase Where is the token authentication middleware implemented, and how does it validate session claims?
Local Embeddings Model Comparison
| Dimension | Transformers.js (Built-in) | Ollama (nomic-embed-text) |
|---|---|---|
| Deployment Complexity | Zero configuration; runs directly inside extension | Requires separate Ollama install and background service |
| Context Window | Limited (~256 to 512 tokens) | Extended (8,192 tokens) |
| Vector Dimension | 384 dimensions | 768 dimensions |
| Hardware Overhead | Minimal CPU / Node.js memory footprint | 300MB - 600MB VRAM or system RAM |
| Code Retrieval Quality | Acceptable for small utilities; poor on large classes | High; preserves whole-function semantics and AST context |
| 365Finds Recommendation | Quick testing or locked corporate laptops | Primary choice for production private development |
Maintenance and Operational Troubleshooting
- Dimension Mismatch on Model Switch: If you transition from Transformers.js (384 dimensions) to
nomic-embed-text(768 dimensions), LanceDB will throw table schema errors because existing tables cannot accept new vector dimensions. Resolve this by closing VS Code, deleting~/.continue/index/, and runningContinue: Codebase Force Re-Index. - Indexer Freezing on Specific Files: If indexing halts at a specific percentage, inspect the developer console (
Help > Toggle Developer Tools). Typically, an unignored minified bundle or gigantic database migration file exceeded the embedding buffer. Add the culprit pattern to.continueignore. - Evolution Toward Agent Mode: In newer versions of Continue,
@codebaseindexing is supplemented by Agent Mode tools (direct file grep and AST symbol lookups). However, local embeddings in LanceDB remain the foundation for fuzzy architectural discovery when developers do not know exact file names or method identifiers.