Configuration Reference

Configuration Reference

This document contains the complete configuration reference for Kodit. All configuration is done through environment variables.

Environment Variables

Environment VariableTypeDefaultDescription
HOSTstring0.0.0.0The server host to bind to.
PORTint8080The server port to listen on.
DATA_DIRstring~/.koditThe data directory path.
DB_URLstringsqlite:///{data_dir}/kodit.dbThe database connection URL.
LOG_LEVELstringINFOThe log verbosity level.
LOG_FORMATstringprettyThe log output format (pretty or json).
DISABLE_TELEMETRYboolfalseTelemetry collection.
SKIP_PROVIDER_VALIDATIONboolfalseProvider requirement validation at startup.
API_KEYSstring(empty)A comma-separated list of valid API keys.
EMBEDDING_ENDPOINT_BASE_URLstring(empty)The base URL for the endpoint.
EMBEDDING_ENDPOINT_MODELstring(empty)The model identifier (e.g., openai/text-embedding-3-small).
EMBEDDING_ENDPOINT_API_KEYstring(empty)The API key for authentication.
EMBEDDING_ENDPOINT_NUM_PARALLEL_TASKSint1The number of parallel tasks.
EMBEDDING_ENDPOINT_SOCKET_PATHstring(empty)The Unix socket path for local communication.
EMBEDDING_ENDPOINT_TIMEOUTfloat60The request timeout in seconds.
EMBEDDING_ENDPOINT_MAX_RETRIESint5The maximum number of retries.
EMBEDDING_ENDPOINT_INITIAL_DELAYfloat2.0The initial retry delay in seconds.
EMBEDDING_ENDPOINT_BACKOFF_FACTORfloat2.0The retry backoff multiplier.
EMBEDDING_ENDPOINT_EXTRA_PARAMSstring(empty)A JSON-encoded map of extra parameters.
EMBEDDING_ENDPOINT_MAX_TOKENSint4000The maximum token limit.
EMBEDDING_ENDPOINT_MAX_BATCH_CHARSint16000The maximum total characters per embedding batch.
EMBEDDING_ENDPOINT_MAX_BATCH_SIZEint1The maximum number of requests per batch.
ENRICHMENT_ENDPOINT_BASE_URLstring(empty)The base URL for the endpoint.
ENRICHMENT_ENDPOINT_MODELstring(empty)The model identifier (e.g., openai/text-embedding-3-small).
ENRICHMENT_ENDPOINT_API_KEYstring(empty)The API key for authentication.
ENRICHMENT_ENDPOINT_NUM_PARALLEL_TASKSint1The number of parallel tasks.
ENRICHMENT_ENDPOINT_SOCKET_PATHstring(empty)The Unix socket path for local communication.
ENRICHMENT_ENDPOINT_TIMEOUTfloat60The request timeout in seconds.
ENRICHMENT_ENDPOINT_MAX_RETRIESint5The maximum number of retries.
ENRICHMENT_ENDPOINT_INITIAL_DELAYfloat2.0The initial retry delay in seconds.
ENRICHMENT_ENDPOINT_BACKOFF_FACTORfloat2.0The retry backoff multiplier.
ENRICHMENT_ENDPOINT_EXTRA_PARAMSstring(empty)A JSON-encoded map of extra parameters.
ENRICHMENT_ENDPOINT_MAX_TOKENSint4000The maximum token limit.
ENRICHMENT_ENDPOINT_MAX_BATCH_CHARSint16000The maximum total characters per embedding batch.
ENRICHMENT_ENDPOINT_MAX_BATCH_SIZEint1The maximum number of requests per batch.
PERIODIC_SYNC_ENABLEDbooltrueWhether periodic sync is enabled.
PERIODIC_SYNC_INTERVAL_SECONDSfloat1800The sync interval in seconds.
PERIODIC_SYNC_RETRY_ATTEMPTSint3The number of retry attempts.
REMOTE_SERVER_URLstring(empty)The remote server URL.
REMOTE_API_KEYstring(empty)The API key for authentication.
REMOTE_TIMEOUTfloat30The request timeout in seconds.
REMOTE_MAX_RETRIESint3The maximum retry attempts.
REMOTE_VERIFY_SSLbooltrueSSL certificate verification.
REPORTING_LOG_TIME_INTERVALfloat5The logging interval in seconds.
LITELLM_CACHE_ENABLEDbooltrueWhether caching is enabled.
WORKER_COUNTint1The number of background workers.
SEARCH_LIMITint10The default search result limit.
HTTP_CACHE_DIRstring(empty)The directory for caching HTTP responses to disk.
SIMPLE_CHUNKING_ENABLEDbooltrueSimpleChunking enables fixed-size text chunking instead of AST-based snippet extraction.
CHUNK_SIZEint1500The target size in characters for each text chunk.
CHUNK_OVERLAPint200The number of overlapping characters between adjacent chunks.
CHUNK_MIN_SIZEint50The minimum chunk size in characters; smaller chunks are dropped.

Applying Configuration

There are two ways to apply configuration to Kodit:

  1. A local .env file (e.g. kodit serve --env-file .env)
  2. Environment variables (e.g. DATA_DIR=/path/to/kodit/data kodit serve)

How you specify environment variables is dependent on your deployment mechanism.

Docker Compose

For example, in docker compose you can use the environment key:

services:
  kodit:
    environment:
      - DATA_DIR=/path/to/kodit/data

Kubernetes

For example, in Kubernetes you can use the env key:

env:
  - name: DATA_DIR
    value: /path/to/kodit/data

Example Configurations

Enrichment Endpoints

Enrichment is typically the slowest part of the indexing process because it requires calling a remote LLM provider. Ideally you want to maximise the number of parallel tasks but all services have rate limits. Start low and increase over time.

See the configuration reference for full details. The following is a selection of examples.

Helix.ml Enrichment Endpoint

Get your free API key from Helix.ml.

ENRICHMENT_ENDPOINT_BASE_URL=https://app.helix.ml/v1
ENRICHMENT_ENDPOINT_MODEL=Qwen/Qwen3-8B
ENRICHMENT_ENDPOINT_NUM_PARALLEL_TASKS=1
ENRICHMENT_ENDPOINT_TIMEOUT=300
ENRICHMENT_ENDPOINT_API_KEY=hl-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Local Ollama Enrichment Endpoint

ENRICHMENT_ENDPOINT_BASE_URL=http://localhost:11434
ENRICHMENT_ENDPOINT_MODEL=qwen3:1.7b
ENRICHMENT_ENDPOINT_NUM_PARALLEL_TASKS=1
ENRICHMENT_ENDPOINT_EXTRA_PARAMS='{"think": false}'
ENRICHMENT_ENDPOINT_TIMEOUT=300