Skip to content

Bring your own model: run RAG on local or cloud LLMs

DocsGPT is model-agnostic: it runs RAG on local LLMs through Ollama, vLLM, llama.cpp, TGI, SGLang or LMDeploy, or on cloud providers such as OpenAI, Anthropic, Google and Azure, with a Model Registry for hot-swapping and bring-your-own-model per user.

Last updated:

Model stack — inside your network or cloud

LLM

localOllama · vLLM · llama.cpp · TGI · SGLang · LMDeploy · Aphrodite · FriendliAI

cloudOpenAI · Anthropic · Google · Azure OpenAI · Groq · OpenRouter · Novita · Hugging Face · DeepSeek

Embeddings

localFastEmbed on ONNX Runtime (granite-311m default) · sentence-transformers

cloudOpenAI · Azure · remote /v1/embeddings

Vector store

localFAISS · pgvector · Qdrant · Milvus · Elasticsearch · LanceDB · MongoDB

cloudMongoDB Atlas · a managed endpoint for any of the above

Object storage

localLocal disk · MinIO or another self-hosted S3 endpoint

cloudAWS S3 · Cloudflare R2 · Backblaze B2 · DigitalOcean Spaces

A fully local stack is a local LLM, local embeddings, a self-hosted vector store and local disk or a self-hosted S3 endpoint such as MinIO. Object storage is one setting either way: STORAGE_TYPE=local or STORAGE_TYPE=s3 with an endpoint URL.

Local and self-hosted engines

Eight engines and a generic OpenAI-compatible adapter, all on your own hardware.

DocsGPT talks to a local inference engine the same way it talks to a cloud provider: set the provider, the base URL and the model name. Ollama and llama.cpp suit a single workstation or a small server; vLLM, TGI, SGLang, LMDeploy and Aphrodite serve larger models on GPUs for many users, and FriendliAI runs behind the same OpenAI-compatible interface. llama.cpp also has a native provider that needs no server at all.

A fully local stack pairs the engine with local embeddings (FastEmbed on ONNX Runtime), a self-hosted vector store and local disk or a self-hosted S3 endpoint such as MinIO. That is the combination the air-gapped posture requires. For GPU classes and VRAM per model size, see hardware fit and sizing.

local LLM + local embeddings + self-hosted store + local disk

  • Ollama:11434/v1
  • llama.cppnative provider or :8000/v1
  • vLLM:8000/v1
  • TGI:8080/v1
  • SGLang:30000/v1
  • LMDeploy:23333/v1
  • Aphrodite:2242/v1
  • FriendliAI:8997/v1
  • Any OpenAI-compatible engine/v1/chat/completions

Cloud providers

Every cloud provider sends prompts and retrieved context to the vendor. Cloud and Managed do this by design; on-premises may (hybrid); air-gapped never does.

Cloud LLM providers, where inference runs and whether data leaves the network
 Provider idWhere inference runsExternal egress
OpenAIresponses api · reasoning effortopenaiVendor cloudYes
Anthropicclaude modelsanthropicVendor cloudYes
Google Vertex AI / Geminigemini modelsgoogleVendor cloudYes
Azure OpenAIazure_deployment_name · openai_api_versionopenai + Azure base URLVendor cloudYes
GroqgroqVendor cloudYes
OpenRouteraggregatoropenrouterVendor cloudYes
NovitaaggregatornovitaVendor cloudYes
Hugging Faceinference apihuggingfaceVendor cloudYes
DeepSeekcatalog entry with its own base_urlopenai_compatibleVendor cloudYes
Any OpenAI-compatible endpointbase url + key, per modelopenai_compatibleProvider or your ownDepends on where it runs
DocsGPT Public APIfree; for evaluationdocsgptArc53Yes

The in-app catalog lists ready-to-pick models for each provider once its key is set.

Model Registry, BYOM and fallback

Change the model behind an agent without a restart.

The Model Registry lists every configured model, local engines and cloud providers side by side, and hot-swaps the model an agent uses from the UI with no restart. It arrived with bring your own model in v0.17.1: an end user registers a model with their own key and base URL, and the connection is SSRF-protected so it cannot be pointed at an internal address.

Fallback runs in two layers. A model can carry an ordered list of backup models, tried in turn when a call fails; if none succeeds, or none is set, the instance-level fallback takes over: FALLBACK_LLM_PROVIDER, FALLBACK_LLM_NAME and its own key. Answers served by a fallback are tagged as such in token and cost attribution.

In workflows each node can override the model, and context compression can run on a separate, cheaper model.

hot swap · byom (ssrf-protected) · backup_models · fallback_llm_* · per-node override

app.docsgpt.cloud — Settings › Models › Add custom model
Add Custom Model dialog: 'Connect any OpenAI-compatible endpoint (Mistral, Together, vLLM, etc.)'. Required fields Display name (placeholder 'My Mistral'), Model ID (e.g. mistral-large-latest), Base URL (https://api.mistral.ai/v1) and API key (sk-…); an optional Description. Under Capabilities, API protocol 'Chat Completions' and Reasoning effort 'Provider default', with Tools and Structured output ticked and Images off, and a Context window of 128000. Buttons: Test connection, Cancel, Save.
app.docsgpt.cloud — Settings › Models › Add custom model
Add Custom Model dialog: 'Connect any OpenAI-compatible endpoint (Mistral, Together, vLLM, etc.)'. Required fields Display name (placeholder 'My Mistral'), Model ID (e.g. mistral-large-latest), Base URL (https://api.mistral.ai/v1) and API key (sk-…); an optional Description. Under Capabilities, API protocol 'Chat Completions' and Reasoning effort 'Provider default', with Tools and Structured output ticked and Images off, and a Context window of 128000. Buttons: Test connection, Cancel, Save.

Embeddings and vector stores

Local embeddings on ONNX Runtime; seven stores, and pgvector unlocks hybrid search and GraphRAG.

Embeddings run locally through FastEmbed on ONNX Runtime. A new installation is pinned to ibm-granite/granite-embedding-311m-multilingual-r2: multilingual, with a 32k-token context and 768 dimensions. An installation that already has an index stays on the model that index was built with, all-mpnet-base-v2, until you re-embed; DocsGPT prints the migration steps. sentence-transformers is still supported, as are OpenAI or Azure embeddings and a remote /v1/embeddings endpoint.

Changing the embedding model means rebuilding the index. Queries and stored vectors have to come from the same model, and because granite-311m and all-mpnet-base-v2 are both 768-dimensional nothing fails loudly. Retrieval just gets worse. Set EMBEDDINGS_NAME, then run the re-embed script; DocsGPT reports any source whose vectors came from a different model.

FAISS is the default vector store and needs no server. pgvector turns your PostgreSQL into the store and is required for hybrid BM25 + vector search and GraphRAG (v0.18). Qdrant, Milvus, Elasticsearch, LanceDB and MongoDB Atlas are supported as vector-only stores.

fastembed · onnx runtime · ibm-granite/granite-embedding-311m-multilingual-r2 · reembed after a swap

Supported vector stores and which support hybrid search and GraphRAG
 RoleHybrid BM25 + vectorGraphRAG
FAISSDefault; file-based, no serverNoNo
pgvectorPostgreSQL extension; required for hybrid search and GraphRAGYesYes
QdrantAlternative vector storeNoNo
MilvusAlternative vector storeNoNo
ElasticsearchAlternative vector storeNoNo
LanceDBAlternative vector storeNoNo
MongoDBAlternative vector store; Atlas or self-hosted, via any connection stringNoNo

Hybrid search and GraphRAG need pgvector (v0.18). Every other store is vector-only: the base store returns no keyword matches, so hybrid retrieval degrades to vector search.

How it runs privately

Model choice decides the posture.

Deployment postures by operator, LLM and external network
 CloudManagedOn-premisesAir-gapped
Who operatesArc53, multi-tenantArc53, dedicated instanceCustomer, with Arc53 supportCustomer, with Arc53 support
LLMCloud provider via Arc53Cloud provider, local engine or your own keyLocal engine, or your cloud LLM (hybrid)Local engine only
External networkYesYesOptionalNone

Hybrid, meaning an on-premises platform calling a cloud LLM, is on-premises, not air-gapped. Air-gapped means zero external network.

The platform is the same in every posture; what changes is the model layer. Air-gapped means a local engine, local embeddings and a self-hosted vector store with no external network. On-premises may add a cloud LLM (hybrid). Cloud and Managed use a provider by default, or your own key.

Compare all four on deployment options; model choice does not change the price. Test a candidate model on your own cases before switching with benchmarks and evals.

Frequently asked questions

Can I run the LLM locally?

Yes. Point DocsGPT at Ollama, llama.cpp, vLLM, TGI, SGLang, LMDeploy, Aphrodite, FriendliAI or any OpenAI-compatible engine running on your own hardware, and pair it with local embeddings and a self-hosted vector store for a fully local stack.

Which local LLM engines work with RAG in DocsGPT?

Ollama, llama.cpp, vLLM, Text Generation Inference (TGI), SGLang, LMDeploy, Aphrodite and FriendliAI are documented with their default ports; llama.cpp also has a native provider that needs no server, and anything else exposing an OpenAI-compatible endpoint works through the generic provider.

Can I switch models without downtime?

Yes. The Model Registry hot-swaps the model an agent uses from the UI without a restart (shipped in v0.17.1), and if a call fails DocsGPT tries the model’s backup models in order, then the instance-level fallback LLM.

Can users bring their own model key?

Yes. With bring-your-own-model (v0.17.1) an end user registers a model with their own API key and base URL; the connection is SSRF-protected so a user cannot point the platform at internal addresses.

Which vector databases are supported?

FAISS (default), pgvector, Qdrant, Milvus, Elasticsearch, LanceDB and MongoDB, either Atlas or self-hosted. Hybrid BM25 + vector search and GraphRAG require pgvector; the others are vector-only.

Do I have to re-index when I change the embedding model?

Yes. Stored vectors and queries must come from the same embedding model, so an existing index has to be rebuilt after a change. The catch is that it does not fail loudly. The current default and the legacy model are both 768-dimensional, so a swap without a re-embed silently returns worse answers. Set the new model, run the re-embed script, and DocsGPT will name any source still holding vectors from another model.

See DocsGPT on your documents

A 30-minute demo on your model of choice, or self-host with Ollama in five minutes.