docs/content/Deploying/DocsGPT-Settings.mdx
import { Callout } from 'nextra/components'
DocsGPT is highly configurable, allowing you to tailor it to your specific needs and preferences. You can control various aspects of the application, from choosing the Large Language Model (LLM) provider to selecting embedding models and vector stores.
This document will guide you through the basic settings you can configure in DocsGPT. These settings determine how DocsGPT interacts with LLMs and processes your data.
There are two primary ways to configure DocsGPT settings:
.env file (Recommended)The easiest and recommended way to configure basic settings is by using a .env file. This file should be located in the root directory of your DocsGPT project (the same directory where setup.sh is located).
Example .env file structure:
LLM_PROVIDER=openai
API_KEY=YOUR_OPENAI_API_KEY
LLM_NAME=gpt-4o
settings.py file (Advanced)For more advanced configurations or if you prefer to manage settings directly in code, you can modify the settings.py file. This file is located in the application/core directory of your DocsGPT project.
While modifying settings.py offers more flexibility, it's generally recommended to use the .env file for basic settings and reserve settings.py for more complex adjustments or when you need to configure settings programmatically.
Location of settings.py: application/core/settings.py
Here are some of the most fundamental settings you'll likely want to configure:
LLM_PROVIDER: This setting determines which Large Language Model (LLM) provider DocsGPT will use. It tells DocsGPT which API to interact with.
docsgpt: Use the DocsGPT Public API Endpoint (simple and free, as offered in setup.sh option 1).openai: Use OpenAI's API (requires an API key).google: Use Google's Vertex AI or Gemini models.anthropic: Use Anthropic's Claude models.groq: Use Groq's models.huggingface: Use HuggingFace Inference API.azure_openai: Use Azure OpenAI Service.openai (when using local inference engines like Ollama, Llama.cpp, TGI, etc.): This signals DocsGPT to use an OpenAI-compatible API format, even if the actual LLM is running locally.LLM_NAME: Specifies the specific model to use from the chosen LLM provider. The available models depend on the LLM_PROVIDER you've selected.
LLM_PROVIDER=openai: gpt-4oLLM_PROVIDER=google: gemini-2.0-flashllama3.2:1b (or any model name available in your setup).EMBEDDINGS_NAME: This setting defines which embedding model DocsGPT will use to generate vector embeddings for your documents. Embeddings are numerical representations of text that allow DocsGPT to understand the semantic meaning of your documents for efficient search and retrieval.
huggingface_sentence-transformers/all-mpnet-base-v2 (a good general-purpose embedding model).API_KEY: Required for most cloud-based LLM providers. This is your authentication key to access the LLM provider's API. You'll need to obtain this key from your chosen provider's platform.
OPENAI_BASE_URL: Specifically used when LLM_PROVIDER is set to openai but you are connecting to a local inference engine (like Ollama, Llama.cpp, etc.) that exposes an OpenAI-compatible API. This setting tells DocsGPT where to find your local LLM server.
STT_PROVIDER: Selects the speech-to-text provider used for microphone transcription in chat and for audio file ingestion through the parser pipeline.
Let's look at some concrete examples of how to configure these settings in your .env file.
To use OpenAI's gpt-4o model, you would configure your .env file like this:
LLM_PROVIDER=openai
API_KEY=YOUR_OPENAI_API_KEY # Replace with your actual OpenAI API key
LLM_NAME=gpt-4o
Make sure to replace YOUR_OPENAI_API_KEY with your actual OpenAI API key.
To use a local Ollama server with the llama3.2:1b model, you would configure your .env file like this:
LLM_PROVIDER=openai # Using OpenAI compatible API format for local models
API_KEY=None # API Key is not needed for local Ollama
LLM_NAME=llama3.2:1b
OPENAI_BASE_URL=http://host.docker.internal:11434/v1 # Default Ollama API URL within Docker
EMBEDDINGS_NAME=huggingface_sentence-transformers/all-mpnet-base-v2 # You can also run embeddings locally if needed
In this case, even though you are using Ollama locally, LLM_PROVIDER is set to openai because Ollama (and many other local inference engines) are designed to be API-compatible with OpenAI. OPENAI_BASE_URL points DocsGPT to the local Ollama server.
MODELS_CONFIG_DIR)DocsGPT ships with a built-in catalog of models for the providers it
supports out of the box (OpenAI, Anthropic, Google, Groq, OpenRouter,
Novita, Azure OpenAI, Hugging Face, DocsGPT). To add your own
models without forking the repo — for example, a Mistral or Together
account, a self-hosted vLLM endpoint, or any other OpenAI-compatible
API — point MODELS_CONFIG_DIR at a directory of YAML files.
MODELS_CONFIG_DIR=/etc/docsgpt/models
MISTRAL_API_KEY=sk-...
A minimal YAML for one provider:
# /etc/docsgpt/models/mistral.yaml
provider: openai_compatible
display_provider: mistral
api_key_env: MISTRAL_API_KEY
base_url: https://api.mistral.ai/v1
defaults:
supports_tools: true
context_window: 128000
models:
- id: mistral-large-latest
display_name: Mistral Large
- id: mistral-small-latest
display_name: Mistral Small
After restart, those models appear in /api/models and are selectable
in the UI. A working template lives at
application/core/models/examples/mistral.yaml.example.
What you can do:
openai_compatible providers (Mistral, Together, Fireworks,
Ollama, vLLM, ...) — one YAML per provider, each with its own
api_key_env and base_url.provider: value as the built-in (e.g. provider: anthropic
with extra models).id — later wins, override is logged at WARNING.What you cannot do via MODELS_CONFIG_DIR: add a brand-new
non-OpenAI provider. That requires a Python plugin under
application/llm/providers/. See
application/core/models/README.md for the full schema reference.
Mount the directory and set the env var:
# docker-compose.yml
services:
app:
image: arc53/docsgpt
environment:
MODELS_CONFIG_DIR: /etc/docsgpt/models
MISTRAL_API_KEY: ${MISTRAL_API_KEY}
volumes:
- ./my-models:/etc/docsgpt/models:ro
If MODELS_CONFIG_DIR is set but the path doesn't exist (or isn't a
directory), the app logs a WARNING at boot and continues with just
the built-in catalog — it does not fail to start. If a YAML
declares an unknown provider name or has a schema error, the app
does fail to start, with the offending file path in the message.
DocsGPT can transcribe audio in two places:
.wav, .mp3, .m4a, .ogg, and .webm files are transcribed first and then passed through the normal parser, chunking, embedding, and indexing pipeline.The settings below control speech-to-text behaviour for both voice input and audio file ingestion.
| Setting | Purpose | Typical values |
|---|---|---|
STT_PROVIDER | Speech-to-text backend provider. | openai, faster_whisper |
OPENAI_STT_MODEL | OpenAI transcription model used when STT_PROVIDER=openai. | gpt-4o-mini-transcribe |
STT_LANGUAGE | Optional language hint passed to the provider. Leave unset for auto-detection when supported. | en, es, unset |
STT_MAX_FILE_SIZE_MB | Maximum file size accepted by the synchronous /api/stt endpoint. | 50 |
STT_ENABLE_TIMESTAMPS | Include timestamp segments in the normalized transcript response and stored parser metadata. | true, false |
STT_ENABLE_DIARIZATION | Reserved provider option for speaker diarization. Some providers may ignore it. | true, false |
STT_PROVIDER=openai
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
OPENAI_STT_MODEL=gpt-4o-mini-transcribe
STT_LANGUAGE=
STT_MAX_FILE_SIZE_MB=50
STT_ENABLE_TIMESTAMPS=false
STT_ENABLE_DIARIZATION=false
If you already use API_KEY for OpenAI, DocsGPT can reuse that key for transcription. Set OPENAI_API_KEY only when you want a dedicated key.
faster_whisperSTT_PROVIDER=faster_whisper
STT_LANGUAGE=en
STT_ENABLE_TIMESTAMPS=true
STT_ENABLE_DIARIZATION=false
faster_whisper is an optional backend dependency. Install it in the Python environment used by the DocsGPT API and worker before selecting this provider.
DocsGPT includes a JWT (JSON Web Token) based authentication feature for managing sessions or securing local deployments while allowing access.
AUTH_TYPE OverviewThe AUTH_TYPE setting in your .env file or settings.py determines the authentication method used by DocsGPT. This allows you to control how users authenticate with your DocsGPT instance.
| Value | Description |
|---|---|
None | No authentication is used. Anyone can access the app. |
simple_jwt | A single, long-lived JWT token is generated at startup. All requests use this shared token. |
session_jwt | Unique JWT tokens are generated for each session/user. |
Add the following to your .env file (or set in settings.py):
# No authentication (default)
AUTH_TYPE=None
# OR: Simple JWT (shared token)
AUTH_TYPE=simple_jwt
JWT_SECRET_KEY=your_secret_key_here
# OR: Session JWT (per-user/session tokens)
AUTH_TYPE=session_jwt
JWT_SECRET_KEY=your_secret_key_here
AUTH_TYPE is set to simple_jwt or session_jwt, a JWT_SECRET_KEY is required.JWT_SECRET_KEY is not set, DocsGPT will generate one and store it in .jwt_secret_key in the project root.Authorization header for all API requests:
Authorization: Bearer <SIMPLE_JWT_TOKEN>
/api/generate_token.Authorization header for subsequent requests.JWT_SECRET_KEY secure and private..jwt_secret_key./api/config endpoint to check the current auth_type and whether authentication is required.simple_jwtIf you have configured AUTH_TYPE=simple_jwt, the DocsGPT frontend will prompt you to enter the JWT token if it's not already set or is invalid. Paste the SIMPLE_JWT_TOKEN (printed to your console when the backend starts) into this field to access the application.
By default DocsGPT stores files locally. Set STORAGE_TYPE=s3 to use Amazon S3 instead.
| Setting | Description | Default |
|---|---|---|
STORAGE_TYPE | local or s3 | local |
S3_BUCKET_NAME | S3 bucket name | docsgpt-test-bucket |
SAGEMAKER_ACCESS_KEY | AWS access key ID | — |
SAGEMAKER_SECRET_KEY | AWS secret access key | — |
SAGEMAKER_REGION | AWS region | — |
URL_STRATEGY | backend (proxy through API) or s3 (direct S3 URLs) | backend |
The S3 credentials use SAGEMAKER_* variable names because they are shared with the SageMaker integration.
STORAGE_TYPE=s3
S3_BUCKET_NAME=your-bucket-name
SAGEMAKER_ACCESS_KEY=your-aws-access-key-id
SAGEMAKER_SECRET_KEY=your-aws-secret-access-key
SAGEMAKER_REGION=us-east-1
Your IAM user needs these permissions on the bucket: s3:PutObject, s3:GetObject, s3:DeleteObject, s3:ListBucket, s3:HeadObject.
DocsGPT stores user data — conversations, agents, prompts, sources, attachments, workflows, logs, and token usage — in PostgreSQL. The backend connects via a single setting:
| Setting | Description | Default |
|---|---|---|
POSTGRES_URI | SQLAlchemy-compatible Postgres URI. Any standard postgresql:// form works — DocsGPT normalizes it internally to the psycopg v3 dialect. | — |
AUTO_CREATE_DB | On startup, connect to the server's postgres maintenance DB and issue CREATE DATABASE if the target is missing. Requires CREATEDB or superuser. No-op when the database already exists. Disable in production. | true |
AUTO_MIGRATE | On startup, run alembic upgrade head against the target database. Idempotent and serialized across workers via alembic_version. Disable in production in favor of an explicit migration step. | true |
Example:
POSTGRES_URI=postgresql://docsgpt:docsgpt@localhost:5432/docsgpt
# Append ?sslmode=require for managed providers that enforce SSL.
With the defaults, the app applies the schema automatically on first
boot. To run it explicitly instead (e.g., in CI/CD or a k8s Job):
python scripts/db/init_postgres.py
The default Docker Compose file bundles a postgres service, and the
app auto-bootstraps the database on boot, so containerized deployments
need no manual migration step. See
PostgreSQL for User Data
for the recommended production flow (both flags false, migrations
gated by CI/CD).
These are just the basic settings to get you started. The settings.py file contains many more advanced options that you can explore to further customize DocsGPT, such as:
VECTOR_STORE, Qdrant, Milvus, LanceDB settings) If you're looking for an easy way to set up a vector store with pgvector, try Neon.RETRIEVERS_ENABLED)CACHE_REDIS_URL)For a complete list of available settings and their descriptions, refer to the settings.py file in application/core. Remember to restart your Docker containers after making changes to your .env file or settings.py for the changes to take effect.