Overview
Knowledge Stack routes all LLM and embedding requests through a LiteLLM proxy. This gateway provides three key capabilities:- Per-tenant cost tracking — Every LLM request is attributed to the tenant that triggered it, giving you full visibility into AI usage costs
- Budget enforcement — You can set spending limits per tenant to control costs
- Model routing — Services reference logical model names (like
general-purposeoringestion-chunk-enrichment) that map to specific provider models in your configuration
How It Works
All AI-powered features in Knowledge Stack — document ingestion, the AI assistant, embeddings, and general-purpose LLM calls — route through the LiteLLM proxy instead of calling LLM providers directly.Per-Tenant Virtual Keys
When a new tenant is created, Knowledge Stack automatically provisions:- A LiteLLM team mapped to the tenant
- An ingestion key for document processing (no budget limit)
- An agent key for AI assistant usage (configurable budget, default $5)
Model Name Mapping
Your services use logical model names that are mapped to actual provider models in the LiteLLM configuration:
You can change the underlying provider model without modifying any application code — just update the LiteLLM configuration.
