DDARE Docs
Reference

Non-chat Model Usage

Every model call DARE makes outside the chat reply, and how each is chosen.

Use this inventory to find every model call outside the user's main chat reply. It separates the shared Background model setting from the embedding, retrieval, document, media, tool and maintenance models that use their own paths.

Executive summary

The Background model selector controls four text-generation jobs:

  1. conversation titles;
  2. rolling conversation summaries;
  3. memory extraction, including historical memory import; and
  4. Advanced RAG query analysis.

It does not control embeddings, reranking, document vision, transcription, image generation, MCP web tools, or maintenance commands. Those layers are listed below so they do not look like hidden uses of the selected chat model.

Complete runtime inventory

LayerWhen it runsModel sourceCredential and routing pathControlled by Background model?
Conversation titleAfter the first message creates a conversationShared background model (see resolution order below)BackgroundModelService, using the active DARE, BYO, group, public-bot, or LiteLLM wallet routeYes
Rolling conversation summaryAfter each configured group of completed assistant replies; default group size is fiveShared background modelBackgroundModelService; queued on the default workerYes
Memory extractionAfter eligible chat turns and during user-requested historical importShared background modelBackgroundModelService; queued on the memory workerYes
Advanced RAG query analysisBefore retrieval when Advanced RAG is enabled; produces intent, keywords, rewrite, and HyDE textShared background modelBackgroundModelService; falls back to the raw query if analysis failsYes
Memory embeddingsWhen a memory statement is stored and when memory retrieval embeds a querytext-embedding-3-small, 512 dimensionsDirect OpenAI client using the server OpenAI keyNo
Document/library embeddingsDuring chunk ingestion and semantic document queriestext-embedding-3-large, normally 3,072 dimensionsDirect OpenAI helper using the server OpenAI keyNo
Advanced RAG rerankingAfter candidate retrievalBAAI/bge-reranker-v2-m3 by defaultLocal sentence-transformers CrossEncoderNo
Document structure parsingDuring file ingestionDocling's local parsing/layout model stackLocal process; OCR is disabled in this pathNo
Document vision enrichmentFor figures and textless PDF pages before chunkingThe user's vision_model default, overridable per OCR run; candidates come from the active wallet, recommendation first (DOCUMENT_ENRICHMENT_MODEL for the catalog, newest Gemini Flash for a proxy)core/services/vision_model_service.py; dispatch and billing follow the chosen model's provider or the LiteLLM proxyNo
Audio transcriptionWhen a user submits audio or voice inputwhisper-1; diarization uses gpt-4o-transcribe-diarizeDirect OpenAI transcription serviceNo
Image generationWhen the user explicitly requests an imageCatalog-selected dall-e-2 or dall-e-3OpenAI image-generation service with generation cost metadataNo
MCP web search/fetchWhen native MCP web tools executeclaude-haiku-4-5-20251001Direct Anthropic server credential in the MCP web serviceNo

The shared Background model path

The four shared jobs call core/services/background_model_service.py, passing the job as a BackgroundTask (titles, summaries, memory, query_analysis). resolve_background_model(user, task) picks the model in this order:

  1. LiteLLM key model: an active LiteLLM wallet whose key has a background_model runs that model on the proxy.
  2. The user's choice: User.background_model, set in Settings → Background models, while the active wallet still offers it (a BYO wallet offers only the providers the user holds keys for; model groups still apply).
  3. Per-task platform override: PlatformSettings.title_model, summary_model, memory_model or query_analysis_model.
  4. Platform default: PlatformSettings.background_model.
  5. Server default: the BACKGROUND_MODEL environment variable (default gpt-5.6-luna in config/env.py).

An ineligible choice is skipped with a warning. Admins edit the platform rows in the Django admin (Platform settings) or in Settings → Background models; both write the same single row, and changes apply on the next call without a restart.

Who pays follows the model that runs:

  • LiteLLM wallet: the proxy route records the usage. A key without its own background model runs the platform model on the DARE wallet.
  • BYO provider key: runs on the user's key when they hold one for the model's provider, recorded at no DARE cost; otherwise the DARE wallet pays.
  • DARE or group wallet: uses the system provider credential; an empty DARE wallet stops the call before dispatch.
  • Public bot: preserves the bot owner/payer attribution rather than billing the anonymous viewer.

Memory extraction and query analysis need structured output. OpenAI and proxy models use their native Pydantic parser; Claude and Gemini receive the same schema as a closed JSON schema and the answer is validated before use. Models without a structured path (local Llama) are not offered.

Shared call sites

  • core/services/conversation_service.py — first-message title generation, capped at 80 characters with New Chat as the fallback.
  • conversations/services/summary_service.py and conversations/tasks.py — rolling summary generation.
  • memory/services/writer.py and memory/tasks.py — structured memory writer, including one repair attempt for malformed structured output.
  • core/services/rag/query_analyzer.py — structured retrieval-query analysis.

Embeddings are separate on purpose, but not unified in routing

Embeddings convert text into vectors for similarity search; they do not write a chat response.

Memory vectors

memory/services/embeddings.py uses text-embedding-3-small with 512 dimensions. It embeds individual extracted memory statements and retrieval queries—not entire conversations. If embedding fails, memory retrieval can still use lexical and recency signals.

This path uses the server OpenAI key directly. An embeddings model exposed by a LiteLLM proxy is not selected automatically, even if the proxy lists one.

Document and library vectors

core/helpers/openai.py, core/services/document_processor.py, and the RAG retrievers use text-embedding-3-large for file chunks and document queries. This is a second direct OpenAI path and is also independent of the Background model selector.

The two embedding pipelines intentionally have different dimensions and vector stores, so changing either model requires a compatible re-embedding migration.

Retrieval layers that do not call a hosted generative model

  • core/services/rag/reranker.py uses the local BAAI/bge-reranker-v2-m3 CrossEncoder to reorder retrieved candidates.
  • BM25 performs lexical scoring with no model API call.
  • MMR performs diversity selection with vector math and no additional model.
  • Grounding consumes existing retrieval/reranker scores; it does not make a second generation call.

Document ingestion layers

core/services/document_parsers/docling_parser.py runs Docling locally to recover document structure. For content that needs visual interpretation, core/services/document_enrichment_service.py calls the vision model that core/services/vision_model_service.py resolves: the user's vision_model (or the per-run override) when the active wallet offers it, otherwise the wallet's first recommendation. For a catalog wallet that is DOCUMENT_ENRICHMENT_MODEL (default gemini-3.1-flash-lite) when visible, then the cheapest vision-capable model.

Document vision is wallet-aware, but it is not the same setting as the shared Background model: choosing Luna for titles and memory does not change the model that reads PDF figures.

Explicit non-chat modalities

Audio transcription and image generation are user-triggered and visible in the product, but they are separate model layers:

  • core/services/whisper_service.py and conversations/services/audio_transcription_service.py handle Whisper and diarized transcription.
  • core/services/openai_service.py and conversations/services/image_generation_service.py handle DALL-E image generation and saved-file metadata.

Neither should appear in the Background model shortlist because neither can do the four shared background text jobs.

Tool and maintenance-only calls

These calls do not participate in ordinary background processing but still use models:

  • mcp/services/web_fetch.py hardcodes Claude Haiku for native web search and fetch tools and uses the server Anthropic credential.
  • api_keys/services.py makes small provider calls only to validate a newly entered API key. These are setup probes, not content-generation layers.
  • conversations/management/commands/update_model_card_public_sentiment.py uses claude-sonnet-5 (CRAWL_MODEL) in an operator-run maintenance command for web research and sentiment updates. It is not part of user request runtime.

Recommendation policy shown in the LiteLLM UI

The selector recommendations are a presentation shortlist, not another model call. The backend ranks at most four entries from the proxy's actual model roster:

  1. one canonical GPT-5.6 Luna route; then
  2. the newest available Gemini Flash models in descending version order; then
  3. other Gemini models if fewer than four recommendations have been filled.

Duplicate Luna aliases are collapsed. GPT-5.6 Sol and Terra are excluded from the recommendation box on purpose; every proxy model stays available in the full dropdown.

Architectural follow-ups

The main transparency gap is that several direct-provider paths bypass both the Background model setting and LiteLLM routing. The highest-value consolidation work would be:

  1. make memory and document embedding routes explicit settings with dimensions treated as migration-sensitive configuration;
  2. expose credential source and cost attribution for every non-chat layer;
  3. move MCP web tools and audio transcription through the same dispatch policy where provider capabilities allow it; and
  4. keep document vision separate by capability, but show its configured model beside the Background model in admin diagnostics.

On this page