Configuration

ChunkHound is configured through a JSON file, environment variables, and CLI flags.

Local-first and provider boundaries

ChunkHound is a local-first runtime: the CLI, the local database, indexing, and the research pipeline run on your machine. Acquisition, indexing, and research stay local by default. Two boundaries are explicit:

  • Web research always egresses. websearch contacts DuckDuckGo for discovery and fetches the source websites; fetchurl contacts the target site. That traffic goes out from your machine and is inherent to web research.
  • Remote providers receive relevant content. If you configure remote embedding, reranking, or LLM providers, the content needed for those requests crosses that provider boundary. Local OpenAI-compatible endpoints (Ollama, vLLM) keep the entire workflow on your hardware.

Choose local providers for fully local operation; there is no mandatory hosted ChunkHound service either way.

This setup keeps the runtime and index local, but sends relevant content to VoyageAI for embeddings and reranking. Before using it with sensitive content, opt out under VoyageAI’s Terms to prevent future submissions from training or improving its service; Voyage requires a payment method for the opt-out. Choose Ollama or vLLM for local/on-prem processing, or a provider/private deployment whose terms meet your organization’s requirements.

Configuration File

Create .chunkhound.json in your project root. Here is a full example showing all sections:

Global Defaults (cross-project configuration)

To avoid copying the same settings into every project, place a global config in one of these locations (checked in order):

  • ~/.config/chunkhound/chunkhound.json
  • ~/.config/chunkhound/.chunkhound.json
  • ~/.chunkhound/chunkhound.json
  • ~/.chunkhound/.chunkhound.json
  • ~/chunkhound.json
  • ~/.chunkhound.json

You can also point to an arbitrary file with the CHUNKHOUND_GLOBAL_CONFIG_FILE environment variable.

Example global config (~/.config/chunkhound/chunkhound.json):

{
  "embedding": {
    "provider": "voyageai",
    "model": "voyage-4-lite"
  },
  "llm": {
    "provider": "deepseek",
    "model": "deepseek-v4-flash"
  },
  "indexing": {
    "exclude": ["**/node_modules/**", "**/.git/**", "**/dist/**"]
  }
}

Then in a specific project you only need a minimal .chunkhound.json for project-specific overrides (or nothing at all if the globals are sufficient):

{
  "embedding": {
    "api_key": "sk-..."   // only the key differs per machine
  }
}

Global values are deep-merged; project files win for any keys they specify.

Merging behavior:

  • Nested objects (embedding, llm, research, database, etc.): deep merge. You only need to specify the keys you want to change in a higher-priority file (local, explicit config, or CLI). Siblings from global (or lower layers) are preserved. This lets a project override just an api_key, switch llm.model, or change research.algorithm without losing other global settings.

  • Lists (indexing.exclude, indexing.include): the list supplied by the higher-priority source completely replaces any list from a lower layer (including global). ChunkHound’s built-in safe defaults are still layered on top of your list in the effective excludes (see get_effective_config_excludes()), and .gitignore interaction is controlled by exclude_mode.

Example — project overrides only the secret while inheriting provider + model from global (or switches providers entirely):

{
  "embedding": {
    "api_key": "sk-..."
  }
}

or to use a completely different provider for this project:

{
  "embedding": {
    "provider": "openai",
    "model": "text-embedding-3-large",
    "api_key": "sk-..."
  }
}

Example — project uses its own exclude list (replaces global’s list at the raw config level):

{
  "indexing": {
    "exclude": ["**/my-vendor/**", "**/generated/**"]
  }
}
{
  "database": {
    "provider": "duckdb",
    "path": ".chunkhound/db"
  },
  "embedding": {
    "provider": "voyageai",
    "model": "voyage-4-lite",
    "batch_size": 100
  },
  "indexing": {
    "exclude": ["**/node_modules/**", "**/dist/**"],
    "exclude_mode": "combined",
    "per_file_timeout_seconds": 3.0,
    "batch_size": 50,
    "db_batch_size": 100,
    "detect_embedded_sql": true
  },
  "llm": {
    "provider": "deepseek",
    "model": "deepseek-v4-flash"
  }
}

Configuration Precedence

Settings are resolved in this order (highest priority first):

  1. CLI arguments – flags passed directly on the command line
  2. Config file – loaded via --config or CHUNKHOUND_CONFIG_FILE
  3. Local .chunkhound.json – auto-detected in the target directory
  4. Global defaults – CHUNKHOUND_GLOBAL_CONFIG_FILE or auto-discovered in ~/.config/chunkhound/ (or ~/.chunkhound/)
  5. Environment variables – CHUNKHOUND_* prefixed variables
  6. Defaults – built-in fallback values

Global defaults let you maintain shared settings (e.g. embedding provider + API key, common exclude patterns, LLM roles) in a single file so you do not need to copy .chunkhound.json into every project. Any project-local .chunkhound.json (or explicit config/CLI) overrides values from the global layer. Nested objects (embedding, llm, research, database, …) are deep-merged: specify only the keys you want to change and siblings from global survive. Lists such as indexing.exclude / include from a higher layer fully replace lower ones (built-in defaults are still applied on top; see Global Defaults above for details and examples).

Remote Configuration

For fleet-wide deployments, ChunkHound can fetch a configuration envelope from an operator-controlled HTTPS endpoint (or http:// to a loopback host for local development) at the start of every invocation, apply a list of rules to the on-disk global config, and seed the discovery-layer remote_config.url / auth_header into the global config file on the first successful fetch so subsequent runs continue fetching without needing the CLI flag or environment variable that triggered the initial run.

Skip this feature for single-user setups — enabling it adds a synchronous fetch with a hard 10-second wall-clock budget to every command (index, search, mcp, etc.), and there is no client-side cache. The intended use case is centralized management across many machines, not local convenience.

Enabling remote fetch

Two knobs, both operator-owned. They may be set via CLI, environment, or the global config file.

Trust boundary. A remote_config key inside a project-local .chunkhound.json or any file passed via --config is scrubbed at load time and a WARNING is logged — project-level files can never redirect the operator’s URL, because a checked-in file could otherwise point first-run fetches at an attacker-controlled endpoint. To persist activation on a machine, place the values in the global config file (~/.chunkhound.json or CHUNKHOUND_GLOBAL_CONFIG_FILE), or leave it to self-registration (below) after a first run with CLI/env.

Setting CLI flag Environment variable
Remote-config URL --remote-config-url CHUNKHOUND_REMOTE_CONFIG__URL
Authorization header --remote-config-auth-header CHUNKHOUND_REMOTE_CONFIG__AUTH_HEADER
# Env-var activation (persists for the shell session)
export CHUNKHOUND_REMOTE_CONFIG__URL="https://config.example.internal/chunkhound"
export CHUNKHOUND_REMOTE_CONFIG__AUTH_HEADER='Bearer ${MY_TOKEN}'
chunkhound index
# One-shot flag activation
chunkhound index \
  --remote-config-url https://config.example.internal/chunkhound \
  --remote-config-auth-header 'Bearer ${MY_TOKEN}'

Envelope format

The endpoint must return a JSON object:

{
  "version": 1,
  "min_chunkhound_version": "5.3.0",
  "rules": [
    { "id": "embedding.model", "op": "set", "value": "voyage-3.5" }
  ]
}
Field Type Required Description
version integer yes Envelope schema version. Must equal 1; any other value is rejected with envelope_version_unsupported.
min_chunkhound_version string no PEP 440 version. If the running client is older, the fetch is discarded so a payload targeted at a newer format never lands on an older binary.
rules array no Ordered list of rule objects (see below). Non-list values are rejected with schema_error.

Rules

Each rule mutates the working-copy config dict. Fields:

Field Type Description
id string Dotted (a.b.c) or slash (a/b/c) path with an optional single leading . or /. Both forms accepted for copy-paste ergonomics.
op string merge (default when omitted), set, or remove.
value any Required for merge and set; ignored by remove.
when object Optional predicates gating this rule. See Predicates below.
min_chunkhound_version string Optional PEP 440 gate applied per-rule. If the running client is older, the rule is skipped with a WARNING (the envelope as a whole is still applied). Unparseable values log a distinct WARNING.

Operation semantics:

  • merge — deep-merge dicts. Collapses to set when either the incoming value or the existing leaf isn’t a dict (nothing to recurse into).
  • set — overwrite the leaf. Missing intermediate keys are created on write.
  • remove — delete the leaf. Missing paths are a no-op (logged).

Rules apply in list order; later rules overwrite earlier ones at the same leaf. Multiple rules may share the same id, and failures are attributed by both 1-based ordinal position and path in log messages so duplicates remain distinguishable.

{
  "version": 1,
  "rules": [
    { "id": "embedding",         "op": "merge", "value": { "model": "voyage-3.5", "batch_size": 100 } },
    { "id": "llm.timeout",       "op": "set",   "value": 180 },
    { "id": "indexing.exclude",  "op": "remove" }
  ]
}

Unknown-path handling. Typos are surfaced, not absorbed:

  • Unknown top-level paths (e.g. embeding.provider) log schema_error and skip the rule.
  • Unknown depth-2 paths (e.g. embedding.provder) are also detected and skipped, because sub-model extra="ignore" semantics would otherwise silently swallow the typo.

Predicates

when gates a rule against runtime state. Predicates are evaluated against a half-merged snapshot — the on-disk global config as it was before any rule ran — so predicate results don’t shift mid-loop as earlier rules mutate the working copy.

Key Value Meaning
os string or list of strings Matches against Python’s sys.platform ("linux", "darwin", "win32", …). The rule applies iff the current platform is in the list.
existing string or list of paths (dotted or slash form) Each path must resolve to a non-None value in the half-merged snapshot. Missing / null paths skip the rule.

Semantics:

  • All predicates must match (AND-logic). A single failing predicate skips the rule silently — the normal, non-error skip path, so log-scraping won’t see spurious WARNINGs from platform-scoped envelopes.
  • Unknown keys inside when (e.g. an unsupported key like arch, or an existng typo of existing) surface as schema_error and skip the rule with a WARNING, so authoring typos don’t quietly apply. Note: this check only fires for keys inside the when block — a typo of the outer key itself (e.g. "wehn": {...} at rule level) is indistinguishable from a rule that simply has no predicates, and applies unconditionally.
{
  "version": 1,
  "rules": [
    {
      "id": "embedding.model",
      "op": "set",
      "value": "voyage-3.5-lite",
      "when": { "os": ["linux", "darwin"] }
    },
    {
      "id": "llm.timeout",
      "op": "set",
      "value": 300,
      "when": { "existing": "llm.provider" },
      "min_chunkhound_version": "5.3.0"
    }
  ]
}

Trust boundary and refused paths

Some settings describe the local install and are protected against server override. After the rule loop, ChunkHound restores these paths from the pre-rules dict, regardless of what any rule did:

  • database.path — DB location is per-machine.
  • target_dir — the directory being indexed.
  • embeddings_disabled — operator kill-switch.
  • local_config_file, global_config_file, config_file — discovery inputs to the loader (allowing remote to override them would recurse).

remote_config.url and remote_config.auth_header are intentionally not refused wholesale — server-driven URL/header rotation is a supported migration path via envelope rules on those keys, and the self-registration step (below) seeds the on-disk value on the first successful fetch so a URL supplied only via CLI or env becomes durable. One narrow guard applies: a rule-set remote_config.url that fails the fetcher’s scheme rule (cleartext http:// to a non-loopback host) is reverted to the pre-rules on-disk value — or removed if there is none — with a WARNING. Persisting such a URL would brick the next fetch, since the fetcher refuses to send credentials over cleartext to a non-loopback host. Every https:// URL passes, so rotation to a new HTTPS origin is unrestricted; remote_config.auth_header has no scheme concept and is accepted verbatim.

Self-registration

The first successful fetch seeds the effective remote_config.url and remote_config.auth_header (from the winning discovery layer — CLI > global > env, matching ChunkHound’s overall config-layer precedence) into the global config file, so subsequent runs continue to fetch without needing the CLI flag or environment variable that triggered the initial run. Precedence:

  • If a rule in the envelope set remote_config.url or remote_config.auth_header, the rule’s value wins and is persisted (server-driven URL/header rotation). For remote_config.url this requires the value to pass the fetcher’s scheme rule; an unsafe URL rule (cleartext http:// to a non-loopback host) is reverted to the on-disk value or removed with a WARNING before this step runs. When the revert leaves the slot empty, discovery-layer seeding still fires — a first-run CLI/env URL survives even when the same envelope also pushed a bad URL rule.
  • Otherwise, if the on-disk file has no value at that path (and no rule set one this run), the discovery-layer value is seeded.
  • If the on-disk file already carries a value at that path, it is left alone — self-registration is gap-fill only, never a rewrite.

The target is:

  1. CHUNKHOUND_GLOBAL_CONFIG_FILE if set, else
  2. the first existing candidate from the global-config search path, else
  3. ~/.chunkhound.json (created if absent).

Writes are atomic (sibling .tmp + replace()), and any pre-existing target file is backed up as <target>.bak first.

On-disk values are durable. Once a URL or header is in the global config file — whether seeded by a first-time fetch, hand-edited by an operator, or written by an op: set rule — a later run with a differing --remote-config-url / --remote-config-auth-header (or env-var equivalent) will fetch against that transient value but will not overwrite what’s on disk. This prevents a one-off invocation from silently replacing a fleet-wide URL. To change a persisted value, edit the global config file directly or push a rule that sets it.

Warning: A literal auth_header value lands on disk in plaintext under the user’s account. ChunkHound restricts the file to the owning user where the OS supports it, but this is not an encryption boundary — anyone who can read the account’s files (privileged local processes, backups, disk images) reads the token verbatim. To persist only a placeholder, use ${VAR} interpolation:

chunkhound index --remote-config-auth-header 'Bearer ${MY_TOKEN}'

The raw templated string Bearer ${MY_TOKEN} is what gets stored; ${MY_TOKEN} is resolved against os.environ at fetch time. If any referenced variable is unset or empty, the entire Authorization header is dropped and a WARNING is logged — a partial interpolation would leak the literal placeholder to the wire.

Delta-only validation gate

After rules apply, the resulting config is snapshot-validated against the current command and every persistence-hazard command (currently index, mcp, and research). Each snapshot returns a set of structured ConfigErrorCode values (see Startup validation). The pipeline compares pre-rules and post-rules error sets on two substrates; both must accept (E_post ⊆ E_pre) or the fetch is discarded:

  1. Persisted global dict — the JSON that would be written, with env / local / --config / CLI skipped, plus worst-case command substitutions (for example forcing mcp.transport=http so host/CORS guards enumerate). This stops a one-off --auth-token, a project-local .chunkhound.json, or a standing CHUNKHOUND_MCP__* env var from masking a newly written global hazard.
  2. Active invocation — every config layer of the current process (CLI, --config, local, global, env), plus the same worst-case substitutions. This stops a rule that is only unsafe in combination with this process’s other sources.

If either comparison introduces a new code, nothing is written and an ERROR is logged naming the substrate (persisted or active), the command, and the code.

This prevents a well-intentioned rule change during a search invocation from silently breaking the next mcp startup or scheduled research run on the same machine, and prevents an overlay on the current process from laundering an unsafe value into the global file.

Fetch behavior and failure model

  • Synchronous on every invocation that goes through create_validated_config.
  • Hard 10-second wall-clock budget enforced by asyncio.wait_for on top of the per-phase httpx timeout, so a slow-drip server cannot stall startup indefinitely.
  • Single attempt. No retries. No client-side cache.
  • Recoverable failures (timeout, transport error, non-2xx response, JSON parse error, envelope validation, min_chunkhound_version gate) log a WARNING and the invocation proceeds against whatever is currently on disk. This is intentional — remote-config outages must not brick indexing or search.
  • Disk-write failures during backup or persist escalate to sys.exit(1) with the target path and errno on stderr. A silent write failure would leave the process running against a stale on-disk copy while advertising success.
  • httpx runs with trust_env=False, so HTTPS_PROXY, HTTP_PROXY, NO_PROXY, SSL_CERT_FILE, SSL_CERT_DIR, and netrc are ignored on the remote-config fetch. This is deliberate: a hostile HTTPS_PROXY could reroute the credentialed request, and a MITM proxy holding a trusted CA could terminate the tunnel and read the Authorization header. Operational consequence — the fetch uses HTTPX’s default CA bundle (certifi.where()) and exposes no CA setting. Installing a private CA only in the OS trust store may not help; add it to the CA bundle the packaged runtime actually uses, or use a certificate that chains to a public root. SSL_CERT_FILE and SSL_CERT_DIR have no effect. The failure looks like any other recoverable fetch WARNING (“Remote-config fetch failed”), which can be mistaken for a flaky server rather than an untrusted CA.

Startup validation

The delta-only gate above relies on structured error codes returned by Config.validate_for_command_structured(). These are also surfaced in normal CLI startup errors alongside their human-readable messages, so log-scraping and monitoring can key off stable identifiers:

Code Trigger
missing_required_config Required top-level configuration is absent for the command.
llm_not_configured No LLM provider configured for a command that needs one.
llm_missing_role_config An LLM role (utility, synthesis, map_hyde, autodoc_cleanup) is missing its provider/model.
embedding_not_configured No embedding provider, or the provider is missing required fields for the command.
mcp_non_loopback_no_auth mcp.host binds to a non-loopback interface without mcp.auth_token.
mcp_cors_no_auth mcp.cors is enabled without mcp.auth_token.
db_readonly_wrong_command database.read_only is true for a command other than mcp.
db_readonly_non_duckdb During mcp, database.read_only is true with a non-DuckDB provider. (Non-mcp commands hit db_readonly_wrong_command first.)

Usage Analytics

ChunkHound can record opt-in usage events and upload them to an S3-compatible bucket. Analytics is off by default. Recorder construction and upload failures never fail a command: a recorder that cannot start becomes a no-op, and upload failures are logged and dropped. Invalid analytics values are rejected during configuration validation like any other setting, so a bad anonymize value or a non-positive interval can still fail startup.

For fleet rollout and the credential policy, see Enterprise Setup.

What is recorded

One command_summary event is written per analytics-wrapped CLI command or MCP tool call. CLI coverage is bounded to index, search, research, websearch, fetchurl, map, autodoc, and calibrate; the mcp command records its tool calls instead.

Field Meaning
type Always command_summary.
user OS username, salted hash, or null, depending on anonymize.
ts UTC ISO 8601 timestamp.
repository Repository name from git remote get-url origin, or the target directory name.
os Platform name (Linux, Darwin, Windows).
chunkhound_version Client version.
command Command or MCP tool name.
source cli or mcp.
duration_ms Command duration.
success Whether the command completed successfully.
action Command-specific fields, with sensitive values redacted by default.
providers Per-kind arrays of provider and model totals.
internal_error_type Internal error class name, recorded only when no provider call failed.

providers maps each kind that has calls (embedding, llm, reranker) to an array of entries. Each entry contains provider, model, calls, fails, error_types, input_tokens, and output_tokens. A token field is null when no call reported it.

action carries a small allowlist, not a generic argument dump:

Command or tool Fields
search (CLI and MCP) query, commit_range, commit_hash, last_n_commits
research / code_research query
websearch query
fetchurl url
index mode, file_count, total_chunks
Other commands Empty object

query, question, and url are set to null unless save_sensitive_data is true. The keys stay present so consumers can see the field existed.

ChunkHound does not record source content, file paths, or full stack traces. It does record repository names, OS, version, command, provider and model names, token counts, commit ranges or hashes, and query text when save_sensitive_data is enabled.

Settings

{
  "analytics": {
    "enabled": false,
    "anonymize": "full",
    "save_sensitive_data": false,
    "s3_endpoint_url": null,
    "s3_bucket": null,
    "flush_interval_seconds": 21600,
    "flush_batch_size": 500,
    "max_upload_retries": 10
  }
}
Setting Default Meaning
enabled false Master opt-in switch.
anonymize "full" full records the OS username, hashed records a salted SHA-256 hash, anonymous omits the identity.
save_sensitive_data false Record query, question, and url verbatim. Independent of anonymize.
s3_endpoint_url null S3-compatible endpoint. Path-style addressing is used.
s3_bucket null Target bucket.
s3_access_key null Access key. Prefer the environment variable below.
s3_secret_key null Secret key. Prefer the environment variable below.
flush_interval_seconds 21600 Maximum time between flushes (6 hours).
flush_batch_size 500 Buffered lines that trigger an early flush.
max_upload_retries 10 Failed upload attempts before the buffer file is dropped.

There are no analytics CLI flags. Set these values in a config file, the environment, or a remote-config rule.

Environment overrides use CHUNKHOUND_ANALYTICS__<KEY>: CHUNKHOUND_ANALYTICS__ENABLED, CHUNKHOUND_ANALYTICS__ANONYMIZE, CHUNKHOUND_ANALYTICS__SAVE_SENSITIVE_DATA, CHUNKHOUND_ANALYTICS__S3_ENDPOINT_URL, CHUNKHOUND_ANALYTICS__S3_BUCKET, CHUNKHOUND_ANALYTICS__FLUSH_INTERVAL_SECONDS, CHUNKHOUND_ANALYTICS__FLUSH_BATCH_SIZE, and CHUNKHOUND_ANALYTICS__MAX_UPLOAD_RETRIES.

The S3 credentials use dedicated names and never fall back to ambient AWS variables:

  • CHUNKHOUND_AWS_ACCESS_KEY_ID
  • CHUNKHOUND_AWS_SECRET_ACCESS_KEY

Identity and the salt

anonymize controls the identity only. It does not change action content. Enabling analytics without setting anonymize records the OS username, because full is the default.

  • full records the OS username.
  • hashed computes a SHA-256 hash of the OS username with a per-install random salt. The salt lives at ~/.config/chunkhound/analytics/salt with 0600 permissions. It is not uploaded. Delete it and the identity changes.
  • anonymous records user: null. The S3 object key uses the shared literal anonymous segment, so anonymous installs are not distinguishable by key.

The repository name is recorded in every mode.

Only the salt is forced to 0600. The recorder creates ~/.config/chunkhound/analytics/ and its buffer files with the process umask. Managed deployments should restrict the directory and set a restrictive umask, especially when save_sensitive_data is true or identity mode is full.

Local buffer and upload

Events are appended to ~/.config/chunkhound/analytics/buffer-<pid>-<timestamp>.jsonl.

  • The active buffer caps at 10 MB. This cap is fixed. Events beyond it are dropped. Total disk use is not capped: pending files can accumulate across runs.
  • A background thread checks once per second. It flushes when the buffer reaches flush_batch_size, or when flush_interval_seconds has passed with pending lines.
  • A flush uploads one object and starts a new active buffer. With no S3 target, the client keeps buffering locally and does not rotate files.
  • Shutdown performs a best-effort flush with a 3-second bound.
  • Orphaned buffer files from crashed processes are retried on later runs when an S3 target exists. A retained file is uploaded by the next recorder with a target, using that recorder’s current endpoint, bucket, repository, and identity for the object key. The event body is not rewritten. Changing destination, repository, identity, or save_sensitive_data can therefore move old events to the new destination, produce key metadata that disagrees with the payload, or leave previously recorded text in place.

The object key is:

analytics/<repository>/<identity>/<YYYY>/<MM>/<DD>/<timestamp>_<hex>.jsonl

The endpoint URL decides the prefix: a trailing slash keeps its path (https://objects.corp.internal/prefix/ lands under prefix/), otherwise the last segment is replaced. https://objects.corp.internal/ lands at the bucket root.

Uploads use one SigV4 PutObject per flush, application/x-ndjson, path-style addressing, and the fixed us-east-1 region. Failed uploads are retried up to max_upload_retries, then the file is dropped. Upload errors are logged; they never fail the host command.

Failure behavior

Condition Behavior
Analytics disabled Recorder is a silent no-op.
No S3 target Local buffer only; the active file caps at 10 MB, but pending files can accumulate.
Invalid S3 endpoint or bucket Upload disabled with a warning; local buffer only.
Buffer directory cannot be created Recorder disabled; the command still runs.
Upload fails Retries, then drops the file.

Embedding Providers

Provider Config Value Env Var Default Model Notes
VoyageAI voyageai CHUNKHOUND_EMBEDDING__API_KEY voyage-3.5 (provider fallback) Set model to voyage-code-4 for maximum code recall. The configurator emits voyage-4-lite + rerank-3-lite explicitly
OpenAI openai CHUNKHOUND_EMBEDDING__API_KEY text-embedding-3-small Widely available

VoyageAI Models

All models below accept output_dims of 256, 512, 1024 (default), or 2048. ChunkHound uses the per-batch token limit to size embedding requests, so picking a model with a larger limit means fewer round trips when indexing.

Model Context Tokens per batch Notes
voyage-code-4 32K 320K Code-specialized, built for coding-agent retrieval. Recommended for code search
voyage-4 32K 320K General purpose, balanced cost and quality
voyage-4-large 32K 120K General purpose, highest retrieval quality
voyage-4-lite 32K 1M Configurator recommendation. General purpose, lowest cost and latency
voyage-code-3 32K 120K Previous-generation code model
voyage-3.5 32K 320K Provider fallback when embedding.model is unset. Previous-generation general purpose
voyage-3.5-lite 32K 1M Previous-generation lite
voyage-3-large 32K 120K Previous-generation large
voyage-finance-2 32K 120K Finance domain, 1024 dims only
voyage-law-2 16K 120K Legal domain, 1024 dims only
voyage-multilingual-2 32K 120K Multilingual, 1024 dims only

Models outside this list still work. ChunkHound discovers their dimensions at runtime and falls back to a conservative 320K token batch limit.

Changing the embedding model

An index built with one embedding configuration cannot be searched with another. Search reads the stored vectors matching the query’s dimensions and filters them by provider and model, so a different model, or the same model at a different output_dims, returns nothing. Re-indexing does not repair a dimensions change either, because chunks that already have vectors for the provider and model are skipped at any dimension. Re-embedding under a new model costs tokens and time, and the superseded vectors stay in the database until removed.

The index therefore keeps the model and dimensions it was built with. Changing embedding.model or embedding.output_dims is a proposal, not an instruction:

Context Behavior
Interactive chunkhound index, different model Warns, shows the chunk count, and asks whether to re-embed. Declining keeps the indexed model and dimensions and asks again next run.
Same model, different output_dims Keeps the indexed dimensions without asking, since the change cannot be re-embedded in place.
Non-interactive (CI, CHUNKHOUND_NO_PROMPTS=1) Warns and keeps the indexed model and dimensions. Nothing is re-embedded.
MCP server startup Keeps the indexed model and dimensions silently, logging the reason to stderr.
Different provider configured Cannot be kept (credentials and dimensions differ), so the configured provider is used and every chunk is re-embedded.

If the index’s dimensions are not valid for its model under the current settings, which can happen for an index built through a custom endpoint, ChunkHound keeps the model, warns that searches will not match, and still starts.

Which model and dimensions an index uses is recorded in a small file beside the database (chunks.db.embedding.json for DuckDB, lancedb.lancedb.embedding.json for LanceDB). It is written the first time an index with vectors is opened and again when a switch is accepted, so a finished or interrupted switch is remembered rather than guessed from vector counts. It is never written for a read-only database. If the file cannot be read, ChunkHound warns, falls back to counting vectors, and leaves the file alone. Both DuckDB and LanceDB indexes are covered.

To adopt a new model deliberately, accept the prompt. To change dimensions, or to start clean, delete the database directory and re-index. To stop being asked, set embedding.model and embedding.output_dims to whatever the index already holds.

For models in the bundled upgrade map, an interactive chunkhound index prints a one-line suggestion naming an alternative. This print-only hint does not mean that the suggested model is better for every workload. It never changes the model or re-embeds on its own and does not appear in non-interactive runs. Set CHUNKHOUND_NO_MODEL_SUGGESTIONS=1 to silence it.

When embedding.model is unset, the VoyageAI provider falls back to voyage-3.5 (and rerank-2.5 for reranking). The homepage configurator does not rely on that fallback: it recommends and emits voyage-4-lite + rerank-3-lite explicitly. Existing configs that omit model keep the fallback, so nothing changes for them. Omitting embedding.rerank_model likewise keeps SDK reranking enabled with the provider default rerank-2.5. There is no config flag to switch SDK reranking off on the official endpoint; pointing embedding at a custom base_url disables it (supports_reranking() returns False unless a rerank_url is set).

Embedding Options

Option Type Default Description
base_url string null Custom embedding endpoint. Required for self-hosted OpenAI-compatible embeddings.
ssl_verify boolean true Verify TLS certificates for requests sent to base_url. Ignored when base_url is unset.
rerank_model string null Reranking model name (enables multi-hop reranking)
rerank_url string null Separate rerank endpoint URL (optional when reranking is served from base_url)
rerank_ssl_verify boolean null Verify TLS certificates for rerank requests. Inherits ssl_verify when unset.
rerank_format string "auto" Reranking API format: cohere, tei, voyage, or auto (voyage for native VoyageAI-compatible endpoints such as MongoDB Atlas — uses top_k and returns a data array)
rerank_batch_size number null Max documents per rerank request
timeout number 30 Request timeout in seconds
max_retries number 3 Max retry attempts on failure
api_version string null Azure OpenAI API version (YYYY-MM-DD)
azure_endpoint string null Azure OpenAI endpoint (mutually exclusive with base_url)
azure_deployment string null Azure OpenAI deployment name

Database Backends

Backend Status Recommended
duckdb Stable Yes — use this
lancedb Experimental No — for evaluation only

DuckDB (default)

Stable — recommended for all use cases.

Fast analytical queries and efficient storage.

{
  "database": {
    "provider": "duckdb",
    "path": ".chunkhound/db"
  }
}

DuckDB storage paths

database.path normally names a directory; ChunkHound stores the database as chunks.db inside it. A path ending in .db or .duckdb is an explicit DuckDB file instead. An existing regular file is also kept as a direct database path for older installations. If no path is configured, the default is <project-root>/.chunkhound/db/chunks.db.

Gotchas:

  • Prefer passing the project directory as a positional argument (chunkhound search "query" /path/to/project) so its .chunkhound.json resolves correctly.
  • A --db path pointing at the wrong subpath silently returns 0 results — no error, just empty. Verify with a regex search first.
  • Pre-v4 flat .chunkhound files block directory creation — move them aside before re-indexing.
  • --config does not override a project-local .chunkhound.json for the DB path — use an explicit --db when the target project has its own config.

LanceDB

Experimental — not recommended for production use. The LanceDB integration is actively developed but may have rough edges around index rebuilding, migration, and edge-case query correctness. Use DuckDB unless you are evaluating LanceDB specifically.

{
  "database": {
    "provider": "lancedb",
    "path": ".chunkhound/db"
  }
}

Database Options

Option Type Default Description
max_disk_usage_mb number null Max DB size in MB before indexing stops (CLI flag uses GB)
fragmentation_threshold_pct number 30 Background/auto-compaction trigger: file-size overhead above the provider’s estimated live DB size (%). 30 = compact when the DB is ~30% larger than live data. 0 = always, null = never. This does not disable the fixed chunkhound index compaction boundaries. CLI: --fragmentation-threshold-pct.
execute_timeout_seconds number null Timeout for synchronous serial DB executor waits (execute_sync / _execute_in_db_thread_sync) in seconds. null = built-in defaults (30s normal ops, 660s compaction). When set, replaces both defaults for every sync operation including compaction, HNSW rebuild, and queries. Does not apply to async dispatch (execute_async), which remains unbounded. CLI: --db-execute-timeout. Env: CHUNKHOUND_DATABASE__EXECUTE_TIMEOUT_SECONDS (or legacy CHUNKHOUND_DB_EXECUTE_TIMEOUT).
lancedb_index_type string null LanceDB vector index type: auto, ivf_hnsw_sq, or ivf_rq
lancedb_optimize_fragment_threshold number 100 Fragment count to trigger LanceDB compaction

DuckDB also compacts during chunkhound index at two fixed batch boundaries: once after chunking and before embedding generation, then again at the end of the indexing pass. Those boundary calls are unconditional, including --no-embeddings and noop re-index runs. If a batch compaction fails with status: "error", the index run is aborted. Providers that report compaction as unsupported/skipped keep indexing normally. Sampled/background auto-compaction (triggered by fragmentation threshold during normal operations) does NOT fail the original operation — failures are logged and skipped.

DuckDB compaction rebuilds a fresh canonical ChunkHound database file and swaps it into place atomically. This is intentionally not a generic DuckDB passthrough: only ChunkHound-owned canonical tables (schema_version, files, chunks, embeddings_*) are preserved. Any unknown or non-canonical tables are dropped during compaction by design.

Indexing Options

Option Type Default Description
exclude string[] built-in list Glob patterns to exclude from indexing
include string[] all supported file types Glob patterns limiting which files are indexed; files not matching any pattern are skipped
exclude_mode string null combined, config_only, or gitignore_only. When an explicit exclude list is provided, defaults to "combined"; otherwise defaults to "gitignore_only"
force_reindex boolean false Force re-indexing of all files
max_concurrent number 5 Max concurrent parser workers
cleanup boolean true Remove orphaned DB records after indexing
max_file_size_mb number 10 Skip files larger than this (MB)
config_file_size_threshold_kb number 20 Skip structured config files (JSON/YAML/TOML) larger than this (KB); 0 to disable
per_file_timeout_seconds number 3.0 Max parse time per file (0 to disable)
batch_size number 50 Files per parsing batch
db_batch_size number 100 Chunks per database write batch
detect_embedded_sql boolean true Index SQL in string literals
per_file_timeout_min_size_kb number 128 Only apply per-file timeout to files at least this large (KB)

By default, ChunkHound excludes common noise directories (node_modules, dist, __pycache__, .git, lock files, build artifacts). Set exclude_mode: "config_only" and exclude: [] to start with a clean slate.

Exclude Modes

  • combined (default when custom exclude patterns are provided) – merges .gitignore rules with your indexing.exclude patterns
  • config_only – only uses patterns from indexing.exclude, ignores .gitignore
  • gitignore_only (default when no custom exclude patterns are provided) – only uses .gitignore rules, ignores config excludes

LLM Configuration

The LLM provider is used for deep code research (chunkhound research and the code_research MCP tool).

The llm section is configured independently of embedding: you can set llm.provider with no embedding config (and vice versa), and the two may point at different providers. ChunkHound validates each section separately per command.

Provider Config Value Env Var Utility Default Synthesis Default Notes
Claude Code CLI claude-code-cli – claude-haiku-4-5-20251001 claude-haiku-4-5-20251001 Uses local Claude Code installation
Codex CLI codex-cli – codex codex Uses local Codex CLI installation
OpenCode CLI opencode-cli – Must be set explicitly via CHUNKHOUND_LLM_MODEL or llm.model Must be set explicitly via CHUNKHOUND_LLM_MODEL or llm.model Uses local OpenCode CLI installation
Anthropic anthropic CHUNKHOUND_LLM_API_KEY claude-haiku-4-5-20251001 claude-haiku-4-5-20251001 Direct API access
OpenAI openai CHUNKHOUND_LLM_API_KEY gpt-5-nano gpt-5 Direct API access
Gemini gemini CHUNKHOUND_LLM_API_KEY Must be set explicitly via CHUNKHOUND_LLM_MODEL or llm.model (configurator defaults to gemini-3.5-flash) Must be set explicitly via CHUNKHOUND_LLM_MODEL or llm.model (configurator defaults to gemini-3.5-flash) Google Gemini API. Migration: CHUNKHOUND_GEMINI_MODEL was removed in v4.x — rename to CHUNKHOUND_LLM_MODEL.
Grok grok CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to grok-4.3) Must be set explicitly (configurator defaults to grok-4.3) xAI API. Registry providers require explicit model.
DeepSeek deepseek CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek-v4-flash) Must be set explicitly (configurator defaults to deepseek-v4-flash) DeepSeek API. Registry providers require explicit model.
OpenRouter openrouter CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek/deepseek-v4.1-flash) Must be set explicitly (configurator defaults to deepseek/deepseek-v4.1-flash) OpenRouter API. Registry providers require explicit model.
Vercel AI Gateway vercel CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek/deepseek-v4.1-flash) Must be set explicitly (configurator defaults to deepseek/deepseek-v4.1-flash) Vercel AI Gateway API. Registry providers require explicit model.
OrcaRouter orcarouter CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to qwen/qwen3.7-flash) Must be set explicitly (configurator defaults to qwen/qwen3.7-flash) OrcaRouter API. Registry providers require explicit model.
Requesty requesty CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek/deepseek-v4.1-flash) Must be set explicitly (configurator defaults to deepseek/deepseek-v4.1-flash) Requesty API. Registry providers require explicit model.
API Route api-route CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to gemini-3.5-flash) Must be set explicitly (configurator defaults to gemini-3.5-flash) API Route API. Registry providers require explicit model.
Opper opper CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to claude-sonnet-5) Must be set explicitly (configurator defaults to claude-sonnet-5) Opper API. Registry providers require explicit model.
Obscurify.ai obscurify-ai CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek/deepseek-v4-flash) Must be set explicitly (configurator defaults to deepseek/deepseek-v4-flash) Obscurify.ai API. Registry providers require explicit model.
Atlas Cloud atlascloud CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek-ai/deepseek-v4-flash) Must be set explicitly (configurator defaults to deepseek-ai/deepseek-v4-flash) Atlas Cloud API. Registry providers require explicit model.
Runcrate runcrate CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek-ai/DeepSeek-V4.1-Flash) Must be set explicitly (configurator defaults to deepseek-ai/DeepSeek-V4.1-Flash) Runcrate API. Registry providers require explicit model.
cheapaimodel cheapaimodel CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek-v4-1-flash) Must be set explicitly (configurator defaults to deepseek-v4-1-flash) cheapaimodel API. Registry providers require explicit model.
UberLLM uberllm CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to deepseek/deepseek-v4.1-flash) Must be set explicitly (configurator defaults to deepseek/deepseek-v4.1-flash) UberLLM API. Registry providers require explicit model.
AIGROW aigrow CHUNKHOUND_LLM_API_KEY Must be set explicitly (configurator defaults to claude-haiku-5.5) Must be set explicitly (configurator defaults to claude-haiku-5.5) AIGROW API. Registry providers require explicit model.

"model" is a convenience shorthand that sets both utility_model and synthesis_model to the same value. To use different models per role, set utility_model and synthesis_model explicitly.

When an OpenAI-compatible LLM provider points at a custom base_url, ChunkHound treats it as a generic custom backend. In that mode you must set an explicit model name; ChunkHound does not guess a local default. This applies to provider: "openai", to registry providers (DeepSeek, Grok, OpenRouter, OrcaRouter, Vercel, Requesty, API Route, Opper, Obscurify.ai, Atlas Cloud, Runcrate, cheapaimodel, and UberLLM) when routed through a non-canonical endpoint, and to per-role overrides that resolve to those providers.

Gateway structured reasoning negotiation

OpenRouter and Vercel AI Gateway can reject requests that disable reasoning for structured (response_format with json_schema) calls. ChunkHound probes this once per provider/model and caches the outcome:

  • Accepted (30-day lease): the reasoning-disable payload stays attached to every structured call for that provider/model, so reasoning is disabled there for the lease duration. Non-structured calls (complete()), including research synthesis, are unaffected.
  • Rejected (24-hour lease): structured calls omit the payload and re-probe once the lease expires. A long-running process enforces the lease in memory, so it re-probes without a restart.
  • Unknown: the first structured call optimistically sends the payload; a 400/422 response triggers one unflagged replay.

Negotiation only happens for the built-in canonical OpenRouter and Vercel AI Gateway endpoints. Setting llm.base_url — even to the canonical URL — routes through a generic backend and disables the probe and payload entirely, exactly like a proxy.

Some models require reasoning and can still return empty content after the payload is dropped, so a rejected cache entry records only the HTTP outcome. When that happens, ChunkHound raises an error naming the provider, model, and capability state, and research results carry a caller-visible note (a > **Note:** blockquote advising a switch of llm.utility_model) plus a metadata.warnings entry.

To reset a stale decision, delete the resolved capability cache file (default ~/.cache/chunkhound/llm-capabilities.json, or %LOCALAPPDATA%\ChunkHound\llm-capabilities.json on Windows) and restart. Set CHUNKHOUND_LLM_CAPABILITY_CACHE to override the path. Constructing a provider does not renew a lease.

On Windows, a .cmd or .bat install of Claude Code, Codex, or OpenCode runs through cmd.exe. A shim path that still has a space after the 8.3 short name is rejected. Arguments there cannot contain a newline, a percent sign, or a quote, and a value with no spaces cannot contain &, |, <, >, ^, (, or ).

Claude Code CLI

provider: "claude-code-cli" runs local claude in print mode. The user request goes to stdin. Research instructions go to the system prompt. --tools and an empty value stay last and disable Claude’s built-in tools.

One delivery mode cannot fit every machine, so llm.claude_append_system_prompt chooses it. The default is file on every operating system: the instructions are written to a temp file and passed with --append-system-prompt-file. That keeps them in the system prompt, off the cmd.exe command line, and beside a wrapper that adds --append-system-prompt on Claude Code 2.1.283 or newer. The file flag alone works from 2.0.34.

Set it to inline to pass --append-system-prompt when the wrapper uses the file flag, when it merges that inline text, or when Claude Code is older than 2.0.34. On a .cmd shim, inline still puts the text through cmd.exe, so quotes, percent signs, newlines, and a very long instruction fail that launch.

A wrapper that uses the same form can drop ChunkHound’s instructions. A wrapper that replaces stdin, or drops the empty --tools value, still breaks the call.

Those files go in the system temp directory. llm.claude_temp_dir overrides that directory for a special case such as Docker or a limited user.

{
  "llm": {
    "provider": "claude-code-cli",
    "claude_append_system_prompt": "file"
  }
}

The environment variables are CHUNKHOUND_LLM_CLAUDE_APPEND_SYSTEM_PROMPT and CHUNKHOUND_LLM_CLAUDE_TEMP_DIR. Both apply only when the provider is claude-code-cli.

LLM Options

Option Type Default Description
utility_provider string null Override provider for utility operations
synthesis_provider string null Override provider for synthesis operations
timeout number 120 LLM request timeout in seconds
max_retries number 3 Max retry attempts
output_limits_enabled boolean false Restore the exact legacy numeric output limits for research synthesis instead of provider-managed limits.
output_limit_fallback number 64000 Positive output-token fallback used when a synthesis provider cannot authoritatively omit a limit or declare one.
claude_append_system_prompt string file file or inline. One mode cannot fit every machine: file stays off cmd.exe and beside a wrapper’s --append-system-prompt; inline is for a file-flag wrapper or Claude Code older than 2.0.34.
claude_temp_dir string system temp Optional override for the Claude instruction file, MCP config file and settings file, such as Docker or a limited user.
codex_reasoning_effort string null Default reasoning effort for Codex/OpenAI: minimal, low, medium, high, xhigh
codex_reasoning_effort_utility string null Reasoning effort override for utility stage
codex_reasoning_effort_synthesis string null Reasoning effort override for synthesis stage

Research Synthesis Output Limits

Provider-managed output limits are the default (llm.output_limits_enabled: false). This policy applies only to the final research synthesis path: single-pass synthesis and the map and reduce calls of map-reduce synthesis. Non-research LLM operations continue to use their existing explicit numeric caps unchanged.

For each provider-managed synthesis request, ChunkHound uses this precedence without guessing limits from model names:

  1. If the selected synthesis provider authoritatively supports omitting the output cap, omit it and let the provider manage the limit.
  2. Otherwise, use an authoritative declared positive maximum only when it includes a durable provider/API source.
  3. Otherwise, send the scalar llm.output_limit_fallback (default 64000).

UNKNOWN omission capability is handled conservatively: ChunkHound does not assume omission is safe, so it uses a valid sourced declaration or the scalar fallback. This is intentionally not a per-model lookup table.

Built-in DeepSeek, Grok, OpenRouter, OrcaRouter, Requesty, and Vercel AI Gateway configurations at their canonical endpoints authoritatively support omission. Provider-managed DeepSeek, OpenRouter, OrcaRouter, Requesty, and Vercel AI Gateway requests omit max_tokens, and provider-managed Grok Chat Completions requests omit max_completion_tokens. Setting a custom base_url on any of these built-ins downgrades omission capability to UNKNOWN; generic OpenAI-compatible endpoints are also UNKNOWN and therefore use a sourced declaration or the configured fallback. An omitted client cap lets the provider apply its own policy—it does not mean output is unlimited.

At research startup, the progress display reports the resolved synthesis request-limit policy using one of these forms (runtime cap values are comma-formatted):

  • Max depth: 1; synthesis request limits: provider-managed (cap omitted)
  • Max depth: 1; synthesis request limits: provider-managed (provider-declared cap: 64,000 tokens)
  • Max depth: 1; synthesis request limits: provider-managed (fallback cap: 64,000 tokens)
  • Max depth: 1; synthesis request limits: legacy numeric (30,000-token single/reduce cap; computed per-map caps)

To roll back exactly to the legacy behavior, set llm.output_limits_enabled: true:

{
  "llm": {
    "output_limits_enabled": true
  }
}

Legacy mode preserves a 30000-token numeric request for single-pass and reduce synthesis. Each map request uses max(5000, int(30000 * cluster_tokens / total_input_tokens)); when total input tokens are zero, every map uses 30000. Provider-managed mode changes only the request’s transport allowance. Prompt guidance remains separate: 15000 for single-pass and reduce synthesis, and min(legacy_map_allowance, 7500) for each map.

Operational caveats:

  • Provider-managed output does not guarantee that the provider will not truncate a response.
  • Native provider truncation signals still raise RuntimeError; synthesis does not retry the truncated stage or return a partial or degraded result.
  • When one concurrent map fails, local sibling cancellation is best-effort. It is not a guarantee that an already-dispatched remote request stopped or that the provider will not bill it.

Anthropic-specific Options

These apply when the active provider (or a role provider) is anthropic. Each option also has a matching CHUNKHOUND_LLM_ANTHROPIC_<OPTION> environment variable (single underscore, uppercased).

Option Type Default Description
anthropic_thinking_enabled boolean false Enable extended thinking.
anthropic_thinking_mode string null auto (default when unset), off, manual, or adaptive. auto selects adaptive on Opus 4.6+/Sonnet 4.6 and manual on older models.
anthropic_thinking_budget_tokens number 10000 Manual-mode thinking budget (min 1024). Ignored in adaptive mode (Opus 4.6+).
anthropic_thinking_display string null Adaptive-mode thinking text: summarized or omitted. Opus 4.7/4.8 omit by default.
anthropic_interleaved_thinking boolean false Manual-mode interleaved thinking between tool calls. Auto-enabled in adaptive mode.
anthropic_effort string null Token-usage effort: low, medium, high, xhigh, max. xhigh is Opus 4.7/4.8 only; max is Opus 4.6+. Unsupported levels are dropped with a warning.
anthropic_task_budget_tokens number null Advisory agentic-loop token budget (beta). Opus 4.7/4.8 only; minimum 20000.
anthropic_prompt_caching boolean false Send cache_control so the Messages API can cache prompt prefixes.
anthropic_cache_ttl string null Prompt-cache TTL such as 1h. null uses the API default of 5 minutes.
anthropic_context_management_enabled boolean false Automatic clearing of tool results and thinking blocks (beta).
anthropic_clear_thinking_keep_turns number null Thinking turns to keep when context management clears them. null keeps all.
anthropic_clear_tool_uses_trigger_tokens number null Input-token threshold that triggers tool-result clearing.
anthropic_clear_tool_uses_keep number null Number of recent tool-use pairs to keep after clearing.

Gemini-specific Options

These apply when the active provider (or a role provider) is gemini. Matching environment variables use the CHUNKHOUND_LLM_GEMINI_* prefix, and the CLI exposes --llm-gemini-thinking-level / --llm-gemini-thinking-budget.

Option Type Default Description
gemini_thinking_level string null Adaptive thinking depth for Gemini 3+ models. Allowed values: low, medium, high. Forwarded to the Google Gen AI SDK as thinking_level.
gemini_thinking_budget number null Fixed thinking token budget for Gemini 2.5+ models. Forwarded to the Google Gen AI SDK as thinking_budget.

Both options can be set independently — thinking_level controls adaptive depth (Gemini 3+), while thinking_budget sets a fixed token cap (Gemini 2.5+). If both are unset, ChunkHound sends no Gemini thinking config and the model uses its own defaults.

Research Configuration

Controls the code_research MCP tool and chunkhound research command.

Option Type Default Env Var Description
algorithm "v1"|"v2"|"v3" "v3" CHUNKHOUND_RESEARCH_ALGORITHM Research algorithm version
query_expansion_enabled bool true CHUNKHOUND_RESEARCH_QUERY_EXPANSION_ENABLED LLM-based query expansion for broader coverage
num_expanded_queries int 2 CHUNKHOUND_RESEARCH_NUM_EXPANDED_QUERIES Number of additional queries to generate (1-5)
initial_page_size int 30 CHUNKHOUND_RESEARCH_INITIAL_PAGE_SIZE Results per vector query in multi-hop search (10-100)
relevance_threshold number 0.5 CHUNKHOUND_RESEARCH_RELEVANCE_THRESHOLD Min rerank score for chunk inclusion (0.3-0.8)
max_symbols int 5 CHUNKHOUND_RESEARCH_MAX_SYMBOLS Max symbols to extract for regex search augmentation (1-20)
regex_augmentation_ratio number 0.3 CHUNKHOUND_RESEARCH_REGEX_AUGMENTATION_RATIO Regex target as fraction of semantic count (0.1-1.0)
regex_min_results int 20 CHUNKHOUND_RESEARCH_REGEX_MIN_RESULTS Min regex results regardless of augmentation ratio (10-100)
regex_scan_page_size int 100 CHUNKHOUND_RESEARCH_REGEX_SCAN_PAGE_SIZE Internal pagination batch size for regex exclusion scanning (50-200)
multi_hop_time_limit number 5.0 CHUNKHOUND_RESEARCH_MULTI_HOP_TIME_LIMIT Max seconds for evidence expansion (1.0-15.0)
multi_hop_result_limit int 500 CHUNKHOUND_RESEARCH_MULTI_HOP_RESULT_LIMIT Max chunks accumulated during multi-hop expansion (100-2000)
multi_hop_min_candidates int 5 CHUNKHOUND_RESEARCH_MULTI_HOP_MIN_CANDIDATES Min candidates above threshold to continue expansion (1-20)
multi_hop_score_degradation number 0.15 CHUNKHOUND_RESEARCH_MULTI_HOP_SCORE_DEGRADATION Max score drop in top-5 before terminating expansion (0.05-0.5)
multi_hop_min_relevance number 0.3 CHUNKHOUND_RESEARCH_MULTI_HOP_MIN_RELEVANCE Quality floor for expansion candidates (0.1-0.8)
depth_exploration_enabled bool true CHUNKHOUND_RESEARCH_DEPTH_EXPLORATION_ENABLED Enable depth exploration to find more chunks in discovered files
max_exploration_files int 5 CHUNKHOUND_RESEARCH_MAX_EXPLORATION_FILES Max files to explore for additional aspects, top-K by score (1-15)
exploration_queries_per_file int 2 CHUNKHOUND_RESEARCH_EXPLORATION_QUERIES_PER_FILE Number of aspect-based queries to generate per file (1-3)
depth_exploration_max_completion_tokens int 10000 CHUNKHOUND_RESEARCH_DEPTH_EXPLORATION_MAX_COMPLETION_TOKENS Token budget for depth exploration query generation (1-50000)
min_gaps int 1 CHUNKHOUND_RESEARCH_MIN_GAPS Minimum gaps to process after selection (0-5)
max_gaps int 10 CHUNKHOUND_RESEARCH_MAX_GAPS Maximum gaps to fill after selection (5-30)
gap_similarity_threshold number 0.25 CHUNKHOUND_RESEARCH_GAP_SIMILARITY_THRESHOLD Cosine distance threshold for clustering similar gaps (0.1-0.5)
shard_budget int 40000 CHUNKHOUND_RESEARCH_SHARD_BUDGET Token budget per gap detection shard for LLM processing (20000-60000)
min_cluster_size int 5 CHUNKHOUND_RESEARCH_MIN_CLUSTER_SIZE Minimum cluster size for HDBSCAN clustering (1-20)
target_tokens int 20000 CHUNKHOUND_RESEARCH_TARGET_TOKENS Output token budget for final synthesis (10000-100000)
max_compression_iterations int 5 CHUNKHOUND_RESEARCH_MAX_COMPRESSION_ITERATIONS Max compression loop iterations before error (1-10)
max_boundary_expansion_lines int 300 CHUNKHOUND_RESEARCH_MAX_BOUNDARY_EXPANSION_LINES Max lines to expand for complete functions/classes (50-500)
max_chunks_per_file_repr int 5 CHUNKHOUND_RESEARCH_MAX_CHUNKS_PER_FILE_REPR Top chunks per file for representative document creation (1-10)
max_tokens_per_file_repr int 2000 CHUNKHOUND_RESEARCH_MAX_TOKENS_PER_FILE_REPR Token limit per file representative document (500-5000)
context_window int 150000 CHUNKHOUND_RESEARCH_CONTEXT_WINDOW Max tokens for LLM context window (50000-200000)
compression_max_depth int 10 CHUNKHOUND_RESEARCH_COMPRESSION_MAX_DEPTH Max recursion depth for hierarchical compression (1-20)
final_synthesis_threshold int 75000 CHUNKHOUND_RESEARCH_FINAL_SYNTHESIS_THRESHOLD Max tokens for final synthesis LLM call (30000-200000)
window_expansion_enabled bool true CHUNKHOUND_RESEARCH_WINDOW_EXPANSION_ENABLED Enable neighboring chunk expansion for context
window_expansion_lines int 50 CHUNKHOUND_RESEARCH_WINDOW_EXPANSION_LINES Lines to expand before/after retrieved chunks (10-200)
import_resolution_enabled bool true CHUNKHOUND_RESEARCH_IMPORT_RESOLUTION_ENABLED Automatically fetch source files for imports in retrieved chunks
import_resolution_max_files int 10 CHUNKHOUND_RESEARCH_IMPORT_RESOLUTION_MAX_FILES Max import source files to fetch per synthesis (1-50)
exhaustive_mode bool false CHUNKHOUND_RESEARCH_EXHAUSTIVE_MODE Enable exhaustive retrieval (no result limit, 600s timeout)
exhaustive_time_limit number 600.0 CHUNKHOUND_RESEARCH_EXHAUSTIVE_TIME_LIMIT Safety timeout for exhaustive mode in seconds (60-1800)
{
  "research": {
    "algorithm": "v3",
    "exhaustive_mode": false,
    "target_tokens": 20000,
    "query_expansion_enabled": true,
    "depth_exploration_max_completion_tokens": 10000,
    "relevance_threshold": 0.5
  }
}

Algorithm Versions

The algorithm setting controls how ChunkHound explores your codebase to answer a research question. All three versions produce the same output format; they differ only in how thoroughly they search.

New to ChunkHound? Start with "v3" (the default).

Version Strategy LLM calls Best for
v1 BFS — generates follow-up questions, explores one level deep Minimal Quick lookups, simple codebases
v2 Wide coverage — depth-first on top files, then gap detection Medium Balanced discovery; most production use cases
v3 (default) Runs v1 + v2 in parallel, merges results Most (parallel, not sequential) Complex codebases where missing context is costly

v3 is not slower than v2 — both strategies run concurrently via asyncio.gather, so the wall-clock time is roughly the same as v2 alone while covering more ground.

When to switch away from v3:

  • Use v1 when cost matters and the question is narrow and self-contained (“explain how the config loader works”)
  • Use v2 when you want a good balance without the extra LLM spend of dual-strategy merging
  • v3 is the right default for open-ended research questions (“how does authentication flow through this system?”)

Gap detection parameters (min_gaps, max_gaps, gap_similarity_threshold) only affect v2 and v3. They are silently ignored for v1.

Environment Variables

Most environment variables use the CHUNKHOUND_ prefix with __ (double underscore) as the section delimiter. The LLM section uses a single underscore (CHUNKHOUND_LLM_*).

Variable Description
CHUNKHOUND_VECTOR_CACHE_MAX_ENTRIES Max cached chunk vectors for git-history/web search (default 10000; 0 disables caching, results are identical)
CHUNKHOUND_VECTOR_CACHE_TTL_SECONDS Seconds since last access before a cached vector expires (default 300)
CHUNKHOUND_VECTOR_SEARCH_OVERFETCH_FACTOR Candidate pool multiplier for git-history/web search (default 5)
CHUNKHOUND_EMBEDDING__PROVIDER Embedding provider name
CHUNKHOUND_EMBEDDING__MODEL Embedding model name
CHUNKHOUND_EMBEDDING__API_KEY API key for embedding provider
CHUNKHOUND_EMBEDDING__BASE_URL Base URL for OpenAI-compatible endpoints
CHUNKHOUND_EMBEDDING__SSL_VERIFY Verify TLS certificates for embedding requests sent to base_url
CHUNKHOUND_EMBEDDING__RERANK_MODEL Reranking model name
CHUNKHOUND_EMBEDDING__RERANK_URL Separate rerank endpoint URL
CHUNKHOUND_EMBEDDING__RERANK_SSL_VERIFY Verify TLS certificates for rerank requests (overrides ssl_verify)
CHUNKHOUND_EMBEDDING__RERANK_FORMAT Reranking API format: cohere, tei, voyage, or auto (voyage for native VoyageAI-compatible endpoints such as MongoDB Atlas — uses top_k and returns a data array)
CHUNKHOUND_EMBEDDING__RERANK_BATCH_SIZE Max documents per rerank request
CHUNKHOUND_EMBEDDING__TIMEOUT Request timeout in seconds (default: 30)
CHUNKHOUND_EMBEDDING__MAX_RETRIES Max retry attempts on failure (default: 3)
CHUNKHOUND_EMBEDDING__API_VERSION Azure OpenAI API version (YYYY-MM-DD)
CHUNKHOUND_EMBEDDING__AZURE_ENDPOINT Azure OpenAI endpoint
CHUNKHOUND_EMBEDDING__AZURE_DEPLOYMENT Azure OpenAI deployment name
CHUNKHOUND_DATABASE__PROVIDER Database backend (duckdb or lancedb)
CHUNKHOUND_DATABASE__PATH Database storage path
CHUNKHOUND_DATABASE__MAX_DISK_USAGE_GB Max database size in GB
CHUNKHOUND_DATABASE__EXECUTE_TIMEOUT_SECONDS Sync serial DB executor timeout in seconds (overrides 30s/660s defaults when set; async dispatch unbounded)
CHUNKHOUND_DATABASE__FRAGMENTATION_THRESHOLD_PCT Auto-compaction fragmentation threshold (%)
CHUNKHOUND_DATABASE__READ_ONLY Open DB read-only (true/1/yes)
CHUNKHOUND_DATABASE__LANCEDB_INDEX_TYPE LanceDB vector index type
CHUNKHOUND_DATABASE__LANCEDB_OPTIMIZE_FRAGMENT_THRESHOLD LanceDB fragment count to trigger optimize
CHUNKHOUND_REMOTE_CONFIG__URL URL to fetch remote configuration on startup (see Remote Configuration)
CHUNKHOUND_REMOTE_CONFIG__AUTH_HEADER Authorization header for the remote-config fetch; supports ${VAR} interpolation against the environment at fetch time
CHUNKHOUND_ANALYTICS__ENABLED Opt in to usage analytics (true/1/yes; default: false)
CHUNKHOUND_ANALYTICS__ANONYMIZE Identity mode: full, hashed, or anonymous (default: full)
CHUNKHOUND_ANALYTICS__SAVE_SENSITIVE_DATA Record query, question, and URL text verbatim (default: false)
CHUNKHOUND_ANALYTICS__S3_ENDPOINT_URL S3-compatible analytics endpoint
CHUNKHOUND_ANALYTICS__S3_BUCKET Analytics bucket
CHUNKHOUND_ANALYTICS__FLUSH_INTERVAL_SECONDS Maximum time between analytics flushes (default: 21600)
CHUNKHOUND_ANALYTICS__FLUSH_BATCH_SIZE Buffered lines that trigger an early flush (default: 500)
CHUNKHOUND_ANALYTICS__MAX_UPLOAD_RETRIES Failed upload attempts before a buffer file is dropped (default: 10)
CHUNKHOUND_AWS_ACCESS_KEY_ID Analytics S3 access key. Deliberately not AWS_ACCESS_KEY_ID
CHUNKHOUND_AWS_SECRET_ACCESS_KEY Analytics S3 secret key. Deliberately not AWS_SECRET_ACCESS_KEY
CHUNKHOUND_LLM_PROVIDER LLM provider for research
CHUNKHOUND_LLM_MODEL LLM model shorthand that sets both utility and synthesis roles
CHUNKHOUND_LLM_UTILITY_MODEL LLM model for utility tasks (fast, lower cost)
CHUNKHOUND_LLM_SYNTHESIS_MODEL LLM model for synthesis tasks (primary output)
CHUNKHOUND_LLM_API_KEY API key for LLM provider
CHUNKHOUND_LLM_BASE_URL Base URL for LLM provider (proxy / custom endpoint)
CHUNKHOUND_LLM_SSL_VERIFY Verify TLS certificates for requests sent to llm.base_url
CHUNKHOUND_LLM_UTILITY_PROVIDER Override provider for utility operations
CHUNKHOUND_LLM_SYNTHESIS_PROVIDER Override provider for synthesis operations
CHUNKHOUND_LLM_TIMEOUT LLM request timeout in seconds (default: 120)
CHUNKHOUND_LLM_MAX_RETRIES Max retry attempts (default: 3)
CHUNKHOUND_LLM_OUTPUT_LIMITS_ENABLED Restore exact legacy research synthesis output limits (true/false; default: false)
CHUNKHOUND_LLM_OUTPUT_LIMIT_FALLBACK Positive provider-managed synthesis fallback in output tokens (default: 64000)
CHUNKHOUND_LLM_CLAUDE_APPEND_SYSTEM_PROMPT file (default) or inline. See Claude Code CLI
CHUNKHOUND_LLM_CLAUDE_TEMP_DIR Optional override for the Claude CLI temp directory. The default is the system temp directory
CHUNKHOUND_LLM_CODEX_REASONING_EFFORT Reasoning effort for Codex models (minimal, low, medium, high, xhigh)
CHUNKHOUND_LLM_CODEX_REASONING_EFFORT_UTILITY Reasoning effort override for utility stage
CHUNKHOUND_LLM_CODEX_REASONING_EFFORT_SYNTHESIS Reasoning effort override for synthesis stage
CHUNKHOUND_LLM_ANTHROPIC_THINKING_ENABLED Enable extended thinking
CHUNKHOUND_LLM_ANTHROPIC_THINKING_MODE Thinking mode: auto, off, manual, or adaptive
CHUNKHOUND_LLM_ANTHROPIC_THINKING_BUDGET_TOKENS Manual-mode thinking budget (min 1024, default: 10000)
CHUNKHOUND_LLM_ANTHROPIC_THINKING_DISPLAY Adaptive-mode thinking text: summarized or omitted
CHUNKHOUND_LLM_ANTHROPIC_INTERLEAVED_THINKING Manual-mode interleaved thinking between tool calls
CHUNKHOUND_LLM_ANTHROPIC_EFFORT Token-usage effort: low, medium, high, xhigh, max
CHUNKHOUND_LLM_ANTHROPIC_TASK_BUDGET_TOKENS Advisory agentic-loop token budget (beta)
CHUNKHOUND_LLM_ANTHROPIC_PROMPT_CACHING Send cache_control for prompt caching
CHUNKHOUND_LLM_ANTHROPIC_CACHE_TTL Prompt-cache TTL (e.g. 1h)
CHUNKHOUND_LLM_ANTHROPIC_CONTEXT_MANAGEMENT_ENABLED Automatic clearing of tool results and thinking blocks (beta)
CHUNKHOUND_LLM_ANTHROPIC_CLEAR_THINKING_KEEP_TURNS Thinking turns to keep when context management clears them
CHUNKHOUND_LLM_ANTHROPIC_CLEAR_TOOL_USES_TRIGGER_TOKENS Input-token threshold that triggers tool-result clearing
CHUNKHOUND_LLM_ANTHROPIC_CLEAR_TOOL_USES_KEEP Number of recent tool-use pairs to keep after clearing
CHUNKHOUND_LLM_GEMINI_THINKING_LEVEL Gemini thinking depth (low, medium, high)
CHUNKHOUND_LLM_GEMINI_THINKING_BUDGET Gemini fixed thinking token budget
CHUNKHOUND_INDEXING__EXCLUDE_MODE Exclusion mode (combined, config_only, gitignore_only)
CHUNKHOUND_INDEXING__EXCLUDE Glob patterns to exclude from indexing
CHUNKHOUND_INDEXING__INCLUDE Glob patterns limiting which files are indexed
CHUNKHOUND_INDEXING__CLEANUP Remove orphaned DB records after indexing (default: true)
CHUNKHOUND_INDEXING__FORCE_REINDEX Force re-indexing of all files (default: false)
CHUNKHOUND_INDEXING__MAX_FILE_SIZE_MB Skip files larger than this (MB, default: 10)
CHUNKHOUND_INDEXING__CONFIG_FILE_SIZE_THRESHOLD_KB Skip structured config files larger than this (KB, default: 20)
CHUNKHOUND_INDEXING__PER_FILE_TIMEOUT_SECONDS Per-file parse timeout (default: 3.0)
CHUNKHOUND_INDEXING__PER_FILE_TIMEOUT_MIN_SIZE_KB Only apply per-file timeout to files at least this large (KB, default: 128)
CHUNKHOUND_INDEXING__BATCH_SIZE Files per parsing batch (default: 50)
CHUNKHOUND_INDEXING__DB_BATCH_SIZE Chunks per database write batch (default: 100)
CHUNKHOUND_INDEXING__MAX_CONCURRENT Max concurrent parser workers (default: 5)
CHUNKHOUND_INDEXING__CHUNK_OVERLAP Internal chunk overlap (default: 50)
CHUNKHOUND_INDEXING__MIN_CHUNK_SIZE Internal min chunk size (default: 50)
CHUNKHOUND_INDEXING__INDEX_UNKNOWN_FILES Index files with unrecognized extensions as plain text (default: false)
CHUNKHOUND_INDEXING__DETECT_EMBEDDED_SQL Enable embedded SQL detection (default: true)
CHUNKHOUND_INDEXING__DISCOVERY_BACKEND File discovery backend: auto, python, git, git_only (default: auto)
CHUNKHOUND_INDEXING__GITIGNORE_BACKEND Backend for gitignore evaluation: python or libgit2 (default: python)
CHUNKHOUND_INDEXING__CHIGNORE_FILE ChunkHound-specific ignore file name (default: .chignore)
CHUNKHOUND_INDEXING__GIT_PATHSPEC_CAP Max git pathspec entries (default: 128)
CHUNKHOUND_INDEXING__MTIME_EPSILON_SECONDS Tolerance for file mtime comparison (seconds, default: 0.01)
CHUNKHOUND_INDEXING__PARALLEL_DISCOVERY Enable parallel directory traversal for large codebases (default: true)
CHUNKHOUND_INDEXING__MIN_DIRS_FOR_PARALLEL Minimum top-level directories to activate parallel discovery (default: 4)
CHUNKHOUND_INDEXING__MAX_DISCOVERY_WORKERS Maximum worker processes for parallel discovery (default: 16)
CHUNKHOUND_INDEXING__WORKSPACE_GITIGNORE_OVERLAY Apply CH root .gitignore as global overlay across repos (default: false)
CHUNKHOUND_INDEXING__WORKSPACE_GITIGNORE_NONREPO Use CH root .gitignore only for non-repo paths (default: true)
CHUNKHOUND_INDEXING__REALTIME_BACKEND Filesystem monitoring backend: watchman, watchdog, or polling
CHUNKHOUND_DB_EXECUTE_TIMEOUT Legacy alias for CHUNKHOUND_DATABASE__EXECUTE_TIMEOUT_SECONDS
CHUNKHOUND_YAML_ENGINE YAML parser engine (rapid or tree)
CHUNKHOUND_CONFIG_FILE Path to config file (alternative to --config)
CHUNKHOUND_WEBSEARCH_TIMEOUT_SECONDS Websearch response deadline in seconds (default: 600). Discovery (DDG) is capped at 60s or a quarter of this, whichever is smaller; fetch+research use the remainder. Cancellation cleanup may outlive the deadline, so a one-shot CLI process can wait briefly during event-loop shutdown. Previously this bounded only the research subprocess, so add headroom if you tuned it. Non-positive or non-finite values fall back to 600.
CHUNKHOUND_DEBUG Enable debug logging
VOYAGE_API_KEY Fallback API key for VoyageAI provider

Advanced routing

The homepage configurator emits the 30-second onboarding shape. Real enterprise deployments often need to hit Azure, a self-hosted endpoint, or an LLM proxy. Below is what ChunkHound actually wires through, and what it doesn’t.

TLS verification for custom endpoints

ssl_verify is explicit now. ChunkHound does not disable certificate verification automatically.

  • embedding.ssl_verify only affects requests sent to an explicit embedding.base_url.
  • embedding.rerank_ssl_verify only affects rerank requests and overrides inherited ssl_verify when set.
  • llm.ssl_verify only affects requests sent to an explicit llm.base_url.
  • If base_url is unset, ssl_verify is ignored for security.
  • If rerank_url is unset, rerank_ssl_verify is ignored.
  • Prefer a proper CA trust chain when possible. Use false only for local endpoints or trusted internal networks with self-signed/private certificates.

Azure OpenAI (embeddings)

ChunkHound’s OpenAI embedding provider speaks Azure OpenAI natively. Supply the four Azure fields and omit base_url — the two are mutually exclusive.

{
  "embedding": {
    "provider": "openai",
    "model": "text-embedding-3-small",
    "api_key": "<YOUR_AZURE_KEY>",
    "azure_endpoint": "https://<resource>.openai.azure.com",
    "api_version": "2024-02-01",
    "azure_deployment": "<your-deployment-name>"
  }
}

LLM-side Azure OpenAI is not supported yet — the llm section has no Azure fields. Use a proxy (see below) if you need to route LLM traffic through Azure.

VoyageAI on Azure ML / AI Foundry

VoyageAI models are available on the Azure Marketplace and in Microsoft Foundry. ChunkHound can target an Azure-hosted Voyage deployment via base_url:

{
  "embedding": {
    "provider": "voyageai",
    "model": "voyage-4-lite",
    "api_key": "<YOUR_AZURE_VOYAGE_KEY>",
    "base_url": "https://<your-resource>.services.ai.azure.com/models",
    "ssl_verify": true,
    "rerank_url": "https://<your-rerank-endpoint>/rerank",
    "rerank_ssl_verify": true,
    "rerank_format": "tei"
  }
}

Caveats:

  • Native Voyage API required. The Azure deployment must expose /v1/embeddings with the native Voyage shape (true for Voyage marketplace listings; verify your specific deployment).
  • Bundled reranker unavailable. VoyageAI’s rerank-* models are not accessible through a custom base_url — the embedding endpoint doesn’t expose /rerank. Run a separate reranker and point rerank_url at it. vLLM with Qwen/Qwen3-Reranker-0.6B is a drop-in option:
    vllm serve Qwen/Qwen3-Reranker-0.6B --task score --port 8000
  • TLS disablement is primarily for the HTTP reranker path. The separate rerank_url path respects ssl_verify / rerank_ssl_verify. For the VoyageAI SDK path, prefer trusted CA configuration such as REQUESTS_CA_BUNDLE.
  • Concurrency throttled to 1 by default when base_url is set, to respect Azure serverless rate limits. Override via max_concurrent_batches if your SKU permits.
  • api_key still required. The validator doesn’t enforce it when base_url is present, but Azure-hosted endpoints still need their own key — supply it.

MongoDB Atlas (Voyage-native reranker)

MongoDB Atlas exposes a native Voyage-compatible rerank endpoint. Use rerank_format: "voyage" (uses top_k and returns a data array):

{
  "embedding": {
    "provider": "voyageai",
    "model": "voyage-4-lite",
    "api_key": "<YOUR_VOYAGE_API_KEY>",
    "rerank_model": "rerank-3-lite",
    "rerank_url": "https://<atlas-host>/v1/rerank",
    "rerank_format": "voyage"
  }
}

In the configurator, select Retrieval → VoyageAI and open Customize reranker to set the Atlas URL, voyage format, and rerank model.

LLM via proxy (Anthropic, OpenAI, and OpenAI-compatible providers)

The Anthropic, OpenAI, Grok, DeepSeek, OpenRouter, OrcaRouter, Vercel, Requesty, API Route, Opper, Obscurify.ai, Atlas Cloud, Runcrate, cheapaimodel, and UberLLM LLM providers all forward base_url to their SDK. Point them at a gateway like LiteLLM or OrcaRouter to centralize auth, logging, and rate limiting:

{
  "llm": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-5-20250929",
    "api_key": "<YOUR_GATEWAY_KEY>",
    "base_url": "https://your-gateway.example.com",
    "ssl_verify": true
  }
}

The gateway must preserve each provider’s native request/response shape — ChunkHound uses the vendor SDKs, not a generic HTTP client.

Vercel AI Gateway is a first-class provider, and the configurator’s default research route selects it with a Vercel AI Gateway API key:

{
  "llm": {
    "provider": "vercel",
    "model": "deepseek/deepseek-v4.1-flash",
    "api_key": "<YOUR_VERCEL_API_KEY>"
  }
}

Both gateway presets pin deepseek/deepseek-v4.1-flash, so switching between them needs no model change. The catalogs list no expiration date for this model, and the gateway documents max_tokens as optional, so provider-managed synthesis sends no output cap (catalogs checked 2026-11).

Local OpenAI-compatible servers (Ollama, vLLM)

Local inference servers that speak the OpenAI API work via provider: "openai" with base_url pointing at the local endpoint. No api_key is needed for servers that don’t enforce auth, but you must set an explicit model.

Ollama

Ollama provides embeddings and LLM inference in a single process. Pull the models you need, then point ChunkHound at the Ollama endpoint:

# Embedding model
ollama pull qwen3-embedding

# LLM — pick one
ollama pull qwen3-coder:30b
ollama pull gemma4:27b

Embedding config (.chunkhound.json):

{
  "embedding": {
    "provider": "openai",
    "model": "qwen3-embedding",
    "base_url": "http://localhost:11434/v1",
    "ssl_verify": false
  }
}

Ollama does not provide a reranking endpoint. To use research, web search, or fetch, configure an external reranker.

LLM config:

Migration note: Do not set llm.provider to "ollama". ChunkHound treats Ollama as an OpenAI-compatible endpoint, so use provider: "openai" with the Ollama base_url and an explicit model.

{
  "llm": {
    "provider": "openai",
    "model": "qwen3-coder:30b",
    "base_url": "http://localhost:11434/v1",
    "ssl_verify": false
  }
}

Use whichever model you pulled in llm.model. For example, set "model": "gemma4:27b" if you want the Gemma 4 path instead of Qwen. ChunkHound does not infer a local default model from base_url.

If your embeddings stay on the official provider but reranking goes to a local HTTPS service with a self-signed certificate, override the reranker only:

{
  "embedding": {
    "provider": "openai",
    "model": "text-embedding-3-small",
    "api_key": "<YOUR_OPENAI_KEY>",
    "rerank_model": "Qwen/Qwen3-Reranker-0.6B",
    "rerank_url": "https://localhost:8001/rerank",
    "rerank_ssl_verify": false,
    "rerank_format": "tei"
  }
}

vLLM

vLLM gives you dedicated processes per model, which is better for throughput and lets you serve HuggingFace model IDs directly. Run embeddings and reranking as separate services, then point the embedding configuration at both endpoints:

# Embeddings
vllm serve Qwen/Qwen3-Embedding-0.6B --port 8000

# Reranker
vllm serve Qwen/Qwen3-Reranker-0.6B --task score --hf-overrides '{"architectures":["Qwen3ForSequenceClassification"],"classifier_from_token":["no","yes"],"is_original_qwen3_reranker":true}' --port 8001

# LLM
vllm serve Qwen/Qwen3-Coder-30B-A3B-Instruct --port 8002

The original Qwen reranker requires the score task and these Hugging Face overrides to expose vLLM’s Cohere-compatible rerank API.

Embedding and reranker config (.chunkhound.json):

{
  "embedding": {
    "provider": "openai",
    "model": "Qwen/Qwen3-Embedding-0.6B",
    "base_url": "http://localhost:8000/v1",
    "rerank_model": "Qwen/Qwen3-Reranker-0.6B",
    "rerank_url": "http://localhost:8001/v1/rerank",
    "rerank_format": "cohere"
  }
}

ChunkHound sends Cohere-compatible rerank requests to the explicit reranker endpoint. For another server that genuinely colocates embeddings and reranking, omit rerank_url and ChunkHound derives /rerank from base_url.

LLM config:

{
  "llm": {
    "provider": "openai",
    "model": "Qwen/Qwen3-Coder-30B-A3B-Instruct",
    "base_url": "http://localhost:8002/v1"
  }
}

Ollama vs vLLM: Ollama is simpler — one process, one command per model. vLLM is better for throughput and gives you full control over each serving process. Both work equally well with ChunkHound as long as llm.model is set explicitly.

The websearch tool searches the web via DuckDuckGo, fetches the top pages, indexes the fetched content in memory, and runs the same deep research pipeline used for local code search. It is available as an MCP tool and as chunkhound websearch.

Web research is inherently external: websearch contacts DuckDuckGo and the source websites it fetches over the network from your machine. Fetched content is rendered, chunked, and indexed locally. Remote embedding, reranking, or LLM providers receive only the content relevant to their requests; local endpoints (Ollama, vLLM) keep processing local.

Requirements

The web search tool requires all three provider capabilities to be configured:

  • Embedding provider — e.g. embedding.provider: "voyageai" or "openai"
  • LLM provider — for query expansion and answer synthesis
  • Reranking — embedding.rerank_model must be set for relevance-aware multi-hop search

If any of these are missing, the MCP websearch tool is not registered (capability gating) and the CLI command will fail.

Parameters

Parameter Type Default Description
query string required Natural-language or keyword query sent to DuckDuckGo
--limit / limit int 30 Max results to fetch (1–100). CLI uses --limit, MCP uses limit.

Environment Variables

Variable Description
CHUNKHOUND_WEBSEARCH_TIMEOUT_SECONDS Websearch response deadline (seconds). Default: 600. Discovery is capped at min(60, total/4); fetch and research share the remainder. Cancellation cleanup may outlive the deadline, so a one-shot CLI process can wait briefly during event-loop shutdown. Previously this bounded only the research subprocess, so add headroom if you tuned it. Non-positive, non-finite, or malformed values fall back to 600.

Fixed Constants

Constant Value Description
WEBSEARCH_LIMIT_MAX 100 Upper bound for the --limit / limit parameter

Browser Dependency

The fetch path uses zendriver (v0.15.3, core dependency — no extra install needed) to drive the system-installed Google Chrome for rich page rendering. Chrome >=124 is required. If Chrome is not found or too old, fetches fall back to urllib (less capable — may miss JS-rendered content and cannot fetch some PDFs).

Research Config Linkage

The web search tool delegates to the same deep research pipeline as code_research. All settings in the Research Configuration section apply: algorithm, multi_hop_time_limit, relevance_threshold, query_expansion_enabled, target_tokens, etc.

Fetch URL

The fetchurl tool fetches a single URL, extracts its content, and returns a focused Markdown answer via one LLM call (short pages) or a rerank+elbow pipeline over page chunks (long pages with a query). It is available as an MCP tool and as chunkhound fetchurl. Fetches use the same zendriver + system Chrome transport as Web Search with the same urllib fallback — see that section’s Browser Dependency note for Chrome version requirements and fallback behavior.

Fetching contacts the target site directly from your machine; the fetched content is processed locally.

Requirements

The fetch URL tool requires two provider capabilities to be configured:

  • LLM provider — for the extraction/answer call
  • Reranker-capable embedding provider — VoyageAI (SDK), or a Cohere/TEI HTTP reranker. rerank_model is required for the VoyageAI SDK and Cohere paths; TEI needs rerank_format=tei + rerank_url (no rerank_model).

If either is missing, the MCP fetchurl tool is not registered (capability gating hides it from tools/list) and the CLI command exits 1 with an explicit error message.

Parameters

Parameter Type Default Description
url string required Absolute http:// or https:// URL. Non-http(s) schemes are rejected, as are hosts resolving to loopback / private / link-local / reserved / multicast / unspecified addresses.
query / --query / -q string "" Optional question. When set, focuses extraction and enables the rerank+elbow path on pages exceeding fetchurl.rerank_threshold_tokens.

Environment Variables

Variable Description
CHUNKHOUND_FETCHURL_RERANK_THRESHOLD_TOKENS Overrides fetchurl.rerank_threshold_tokens.
CHUNKHOUND_FETCHURL_TRUNCATE_TOKENS Overrides fetchurl.truncate_tokens.
CHUNKHOUND_FETCHURL_MAX_RETRIES Overrides fetchurl.max_retries.

Configuration File

{
  "fetchurl": {
    "rerank_threshold_tokens": 15000,
    "truncate_tokens": 15000,
    "max_retries": 3
  }
}
Key Type Default Description
rerank_threshold_tokens int (≥1) 15000 Estimated token count above which the chunk-rerank path (chunk + rerank + elbow filter) is used instead of the truncate path (token-truncate + single LLM call). Only applies when query is set — without a query, the truncate path is always used regardless of page size. Tokens are estimated at 4 chars/token.
truncate_tokens int (≥1) 15000 Token cap applied to the truncate-option input before the LLM call. Content is sliced to truncate_tokens × 4 characters.
max_retries int (1–10) 3 Fetch attempts including the first. Uses exponential backoff with full jitter capped at 8s. Browser-transport death consumes an attempt slot and downgrades remaining attempts to urllib.

CLI vs MCP: The three knobs above are exposed as --fetchurl-* flags on the CLI (chunkhound fetchurl). The MCP fetchurl tool accepts only url and query — knob overrides must come from config or CHUNKHOUND_FETCHURL_* env vars.