AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Configuring Local Codebase Indexing and Private Embeddings in Continue for VS Code

Natalia Amaral · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

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:

  1. 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.
  2. 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).
  3. 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.
  4. 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.

  1. Install Ollama and pull the embedding model:
    ollama pull nomic-embed-text
    
  2. Ensure the Ollama background daemon is running:
    ollama serve
    
    By default, it listens at http://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:


Step 5: Triggering and Validating Codebase Indexing

  1. Trigger Indexing: Open the VS Code Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and execute: Continue: Codebase Force Re-Index
  2. 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.
  3. Query via @codebase: In the Continue chat panel, type @codebase followed by your question:
    @codebase Where is the token authentication middleware implemented, and how does it validate session claims?
    
    Continue will retrieve the top matching chunks from local LanceDB, display the referenced files above the response, and synthesize the answer completely offline.

Local Embeddings Model Comparison

DimensionTransformers.js (Built-in)Ollama (nomic-embed-text)
Deployment ComplexityZero configuration; runs directly inside extensionRequires separate Ollama install and background service
Context WindowLimited (~256 to 512 tokens)Extended (8,192 tokens)
Vector Dimension384 dimensions768 dimensions
Hardware OverheadMinimal CPU / Node.js memory footprint300MB - 600MB VRAM or system RAM
Code Retrieval QualityAcceptable for small utilities; poor on large classesHigh; preserves whole-function semantics and AST context
365Finds RecommendationQuick testing or locked corporate laptopsPrimary choice for production private development

Maintenance and Operational Troubleshooting

References