RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /Local AI for Code Generation
  6. /Ch. 8
Local AI for Code Generation

08. Context Providers

Chapter 8 of 18 · 20 min
KEY INSIGHT

Context providers extend Continue's awareness beyond the current file, enabling models to reason about entire repositories, documentation, git history, and external resources. Context providers define how Continue gathers relevant information to include with user requests. Without context providers, the model sees only the current file and selection. With providers, you can give the model repository-wide awareness. Configure context providers in `config.json`: ```json { "contextProviders": [ { "name": "open", "params": {} }, { "name": "diff", "params": {} }, { "name": "terminal", "params": {} } ] } ``` The built-in providers include: **`open`**: Indexes all files in the workspace for semantic search. The model can find related files by asking questions like "Find the file that handles user authentication" or "Which files use this database model?" **`diff`**: Provides the current git changes. When you have uncommitted modifications, the model sees what you're changing and can suggest contextually appropriate completions based on your in-progress work. **`terminal`**: Captures terminal output from the last command. Useful for debuggingΓÇöpaste error messages directly into chat and ask for solutions. **`google`**: Searches the web for documentation and examples. Useful for integrating external knowledge when local documentation is incomplete. **`search`**: Provides the results of ripgrep searches against the workspace. Ask "Where is the login function defined?" and the provider surfaces the relevant code locations. Additional providers available through Continue's plugin ecosystem: ```json { "contextProviders": [ { "name": "codebase", "params": { "n": 20, "description": "The codebase context provides a brief overview of your codebase and relevant code from your codebase. Use this when you need to understand or reference parts of your codebase." } }, { "name": "docs", "params": { "url": "https://docs.example.com" } } ] } ``` Context providers add tokens to every request, which increases latency and may exceed model context limits in large repositories. Limit provider usage with `n` parameters to control how many results are retrieved. The `@` syntax references context providers directly in chat. Type `@` followed by the provider name to activate it for the current message: ``` @codebase How is authentication handled across the codebase? ``` The model receives indexed information from the provider, enabling repository-aware responses without manual file attachment. Workspace indexing builds a searchable representation of your codebase. Indexing happens on first use and updates incrementally as files change. The `codebase` provider uses embeddings to find semantically similar codeΓÇöwhen you ask about "database connection pooling," it surfaces files discussing connection pools even if those exact words don't appear. Debugging context providers: 1. Check provider configuration syntax in `config.json` 2. Verify workspace is indexed by asking simple questions like "What files are in this project?" 3. Monitor token usage in the UI to see how much context providers contribute 4. Disable providers selectively to isolate issues

EXERCISE

Configure the open, diff, and codebase context providers. Ask questions that require each provider's capabilities: find a specific function definition (open), reference your current changes (diff), and query across the codebase (codebase). Note response quality differences.

← Chapter 7
Custom Commands
Chapter 9 →
Code Review Automation