Skip to main content

Configuration

All configuration is done via .env.ragpack, created by ragpack init. The file is read on startup — restart the stack after making changes.

ragpack stop && ragpack start

Embedding providers

RagPack needs an embedding model to index and query documents. Set DEFAULT_EMBED_PROVIDER to one of ollama, openai, or tei.

Ollama (default, fully local)

DEFAULT_EMBED_PROVIDER=ollama
OLLAMA_BASE_URL=http://ollama:11434
OLLAMA_EMBED_MODEL=nomic-embed-text

Start the stack with the Ollama profile to include the Ollama service:

ragpack start --profile ollama

OpenAI

DEFAULT_EMBED_PROVIDER=openai
OPENAI_API_KEY=sk-...
OPENAI_EMBED_MODEL=text-embedding-3-small

HuggingFace TEI (self-hosted)

DEFAULT_EMBED_PROVIDER=tei
TEI_BASE_URL=http://localhost:8080
TEI_EMBED_MODEL=BAAI/bge-small-en-v1.5

LLM providers

An LLM is required to use the RAG endpoint (collection.rag()). Set DEFAULT_LLM_PROVIDER to one of openai, ollama, or anthropic.

If no LLM provider is configured, semantic search (collection.findSimilar()) still works — only RAG is unavailable.

OpenAI

DEFAULT_LLM_PROVIDER=openai
OPENAI_API_KEY=sk-...
OPENAI_LLM_MODEL=gpt-4o-mini

Ollama

DEFAULT_LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://ollama:11434
OLLAMA_LLM_MODEL=llama3.2

Anthropic

DEFAULT_LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-...
ANTHROPIC_MODEL=claude-haiku-4-5-20251001

Ingestion

WORKER_COUNT=5 # concurrent ingestion workers
EMBED_RATE_LIMIT=10 # max embedding API calls per second
MAX_UPLOAD_SIZE_MB=20 # max file upload size

EMBED_RATE_LIMIT is especially important when using an external provider like OpenAI — set it to stay within your API tier's rate limit.

Chunking defaults

These apply to all collections unless overridden at collection creation time.

CHUNK_STRATEGY=auto # auto | paragraph | sliding_window | section | unit | row_group
CHUNK_SIZE=2000 # max characters per chunk
CHUNK_OVERLAP=200 # characters carried into the next chunk

RAG defaults

DEFAULT_PROMPT_SLUG=basic_rag # prompt template used when none is specified

Full reference

VariableDefaultDescription
DEFAULT_EMBED_PROVIDERollamaEmbedding provider: ollama | openai | tei
OLLAMA_BASE_URLhttp://ollama:11434Ollama server URL
OLLAMA_EMBED_MODELnomic-embed-textOllama embedding model
OPENAI_API_KEYOpenAI API key
OPENAI_EMBED_MODELtext-embedding-3-smallOpenAI embedding model
TEI_BASE_URLhttp://localhost:8080TEI server URL
TEI_EMBED_MODELBAAI/bge-small-en-v1.5TEI embedding model
DEFAULT_LLM_PROVIDERLLM provider for RAG: openai | ollama | anthropic
OPENAI_LLM_MODELgpt-4o-miniOpenAI LLM model
OLLAMA_LLM_MODELllama3.2Ollama LLM model
ANTHROPIC_API_KEYAnthropic API key
ANTHROPIC_MODELclaude-haiku-4-5-20251001Anthropic model
WORKER_COUNT5Concurrent ingestion workers
EMBED_RATE_LIMIT10Max embedding API calls per second
MAX_UPLOAD_SIZE_MB20Max file upload size in MB
CHUNK_STRATEGYautoDefault chunking strategy
CHUNK_SIZE2000Max characters per chunk
CHUNK_OVERLAP200Overlap characters between chunks
DEFAULT_PROMPT_SLUGbasic_ragDefault RAG prompt template