Skip to content

Choose inference providers

Configure the chat and embedding providers that consolidation and long memory use, then prove both roles work before real users write to the instance.

Before you start

Two provider roles

Hivemind calls inference providers in two separate roles. Each role has its own provider, endpoint, credential and model.

Role Used for
Chat MID consolidation and compaction, LONG extraction (entities and relations), automatic ontology construction, and the opt-in answer mode of long_query
Embedding LONG ingestion, transfer of MID archives into LONG, semantic retrieval by long_query, and LONG reindexing

Both the Hivemind Core service and the embedded Graph Memory runtime read the same root .env file and resolve the same role profiles.

What each memory horizon needs

Horizon Needs Without it
SHORT (notes) No provider short_note, short_read and short_search (text search) keep working
MID (memory bank) Chat Reading the bank works; consolidation returns status: error with the diagnostic provider_unconfigured, so new notes are never folded into the bank
LONG (knowledge graph) Chat and embedding Ingestion and archive transfer cannot complete; long_query cannot vectorize its query

Hivemind can start in a degraded state without a provider. Authenticated system_health then reports degraded, and the inference block (services.llmaas) shows each missing role with configured: false and connectivity: not_configured. Core requires a chat profile when HOURLY_SUMMARIES_ENABLED=true, analytics are enabled and HIVEMIND_AUTH=on. A partial role, a mixed configuration or an unknown inference variable also causes startup to fail before any provider network access.

Supported profiles

The provider profiles reference defines four frozen reference profiles with exact models and dimensions:

Profile Chat provider Embedding provider
cloud-temple-reference Cloud Temple Cloud Temple
openai-reference OpenAI OpenAI
anthropic-cloud-temple-reference Anthropic (native Messages API) Cloud Temple
gemini-reference Google Gemini Google Gemini

A profile listed here says nothing about your account's model access, quota or pricing. mistral-reference exists as an experimental profile outside these four reference profiles.

Beyond the reference profiles, the registered provider identifiers are cloud-temple, scaleway, openai, mistral, gemini, ovhcloud, anthropic, ollama and openai-compatible. Registration means Hivemind can talk to that provider. Named hosted providers accept only their documented HTTPS endpoint, ollama only its documented local one; use openai-compatible for any other endpoint or gateway. anthropic is chat-only and must be paired with a separate embedding provider.

Cost drivers

Hivemind publishes no cost figure for an instance: it depends on your provider's current pricing, your models and your workload. Check the pricing links in the profiles reference for your account. Expect spending to grow with:

  • Consolidation volume. Each run sends notes in batches of CONSOLIDATION_BATCH_SIZE; automatic consolidation starts at AUTO_CONSOLIDATION_THRESHOLD eligible notes. A batch may need a correction call and up to CONSOLIDATION_TRANSIENT_RETRIES retries; calls can be billed even when they time out without reporting usage.
  • Automatic MID maintenance. MID_AUTO_COMPACT adds chat calls to compact oversized bank files; MID_AUTO_ARCHIVE sends archived MID content into LONG, which costs extraction and embedding calls.
  • LONG ingestion. Each document costs extraction calls (more of them when EXTRACTION_CHUNK_SIZE is smaller) and one embedding per chunk. TEMPORAL_OCCURRENCE_EXTRACTION=true is experimental and costs more.
  • Queries. Every long_query embeds its query; its answer mode also calls the chat model. When the latest version of each bank file does not answer a Memory question, the query is embedded and the chat model called once more to search older versions.
  • Provider specifics. With INFERENCE_EMBEDDING_PROVIDER=gemini, a batch of N inputs costs N embedding requests (at most 2N with retries).
  • Maintenance. A LONG reindex re-embeds the space; each inference_self_test sends one bounded request per role.
  • Token budgets. INFERENCE_CHAT_MAX_OUTPUT_TOKENS caps each chat response, including hidden reasoning on reasoning models.

What to have at hand

  • Shell access to the host and its root .env file (mode 0600).
  • For each role: provider identifier, endpoint URL, model id, and a credential stored in your secret manager. The embedding role also needs the model's vector dimensions.
  • For the self-test, a Portal account with the deployment operator role and a desktop browser with a developer console. No agent credential can run the self-test, whatever its grants.
  • A disposable space and non-sensitive test data.

Steps

  1. Choose the configuration family. New deployments use the split role families INFERENCE_CHAT_* and INFERENCE_EMBEDDING_*. The legacy LLMAAS_* family remains supported through 1.x as one OpenAI-compatible endpoint shared by both roles. Never mix the two: any INFERENCE_* variable selects the split family, and a remaining LLMAAS_* variable then stops startup. To move an existing deployment, follow the strict migration.

  2. Write both role blocks in .env. Each role is all-or-nothing: set its provider, URL, key and model, plus the context window and output ceiling for chat and the dimensions for embedding. This example shows the shape of an OpenAI configuration with the context window and output ceiling the reference profiles use. Take the exact model ids and dimensions of the profile you choose from exact split configuration.

    INFERENCE_CHAT_PROVIDER=openai
    INFERENCE_CHAT_API_URL=https://api.openai.com/v1
    INFERENCE_CHAT_API_KEY=<chat-api-key>
    INFERENCE_CHAT_MODEL=<chat-model>
    INFERENCE_CHAT_CONTEXT_WINDOW=131072
    INFERENCE_CHAT_MAX_OUTPUT_TOKENS=16384
    INFERENCE_EMBEDDING_PROVIDER=openai
    INFERENCE_EMBEDDING_API_URL=https://api.openai.com/v1
    INFERENCE_EMBEDDING_API_KEY=<embedding-api-key>
    INFERENCE_EMBEDDING_MODEL=<embedding-model>
    INFERENCE_EMBEDDING_DIMENSIONS=<embedding-dimensions>
    

    INFERENCE_CHAT_MAX_OUTPUT_TOKENS must stay strictly below INFERENCE_CHAT_CONTEXT_WINDOW and at most 1,000,000. INFERENCE_EMBEDDING_DIMENSIONS must equal the vector length the model returns; it is never sent to the provider.

  3. Declare the embedding input capacity. Set INFERENCE_EMBEDDING_MAX_INPUT_BYTES to a positive ceiling, in UTF-8 bytes, that you have qualified for your model, tokenizer and endpoint. Only the openai provider with text-embedding-3-small, text-embedding-3-large or text-embedding-ada-002 has a built-in ceiling (8,192 bytes). Graph Memory requires an explicit ceiling for every other configured profile and refuses startup when it is missing. Legacy profiles use LLMAAS_EMBEDDING_MAX_INPUT_BYTES. Qualify the value for your own model and endpoint. See embedding input capacity. Core waits for Graph Memory readiness with the base Compose file. The local and authenticated overlays let Core start while Graph Memory checks readiness. If the Portal loads with LONG unavailable, check docker compose logs graph-memory using the same Compose files.

  4. Set optional chat tuning only if you need it. INFERENCE_CHAT_EFFORT (reasoning effort) is accepted only with the openai and openai-compatible providers. INFERENCE_CHAT_TEMPERATURE is optional; the reference profiles omit it so the provider default applies. A configuration you compose this way is outside the reference profiles.

  5. If outbound traffic must use a corporate proxy, set PROXY_URL. Core and Graph Memory then send their provider and S3 traffic through it and fail closed if the proxy fails.

  6. Restart the stack with the command you used to install and start it, so that Core and the embedded Graph Memory service both load the new configuration. The configuration is frozen at startup.

Switching the embedding provider, endpoint, model or dimensions later changes the embedding identity of every existing space. Those spaces become reindex_required: keep writers stopped and follow the bounded reindex. Hivemind never rewrites or deletes vectors automatically.

Verify

  1. Startup completes. A configuration error names the offending variables (never their values) and stops the service before any network access.

  2. Call system_health with any valid credential. With both roles reachable, the top-level status is healthy and services.llmaas.status is ok. This check only discovers models and spends no tokens; the self-test in step 3 exercises your credential, quota and model.

  3. Run the self-test, inference_self_test, from a deployment operator's browser session. On 1.7.0 only a signed-in session that holds the deployment operator role, checked again on every call, may run it. Every agent credential (MCP bearer, OAuth connection or credential imported from 1.6) receives auth17_operator_unqualified whatever its grants, and the Portal has no button for it. The self-test spends provider budget: run it under your cost policy.

    1. Sign in to the Portal at https://hivemind.example.org as a deployment operator. Operator tools must show Configuration.
    2. In that same tab, open the browser's developer console and run this request. Your browser may first ask you to allow pasting.

      const csrf = document.cookie.split(';').map(c => c.trim())
        .find(c => c.startsWith('__Host-hivemind_csrf='))
        ?.slice('__Host-hivemind_csrf='.length);
      const response = await fetch('/api/tool', {
        method: 'POST',
        credentials: 'same-origin',
        headers: { 'Content-Type': 'application/json', 'X-Hivemind-CSRF': csrf },
        body: JSON.stringify({ tool: 'inference_self_test', arguments: {} }),
      });
      console.log(response.status, await response.json());
      

      It is the request the Portal's own Configuration and Audit screens send for their tools: POST /api/tool over HTTPS, with the session cookie __Host-hivemind_session that the browser attaches, the session's CSRF value (the __Host-hivemind_csrf cookie) in the X-Hivemind-CSRF header, and the same-origin Origin header the browser adds. Never add an Authorization header: the request would then be an agent call and be refused.

    3. Read the answer. HTTP 200 carries the tool result: status: ok and readiness: ready when both roles answered, status: error and readiness: not_ready otherwise. roles.chat and roles.embedding each give configured and readiness, then, when known, the provider, the configured and resolved model, the expected and effective dimensions for embedding, token counts, and error_category with retryable for a failure. No secret appears.

    A fresh run sends one synthetic request per configured role, without retry and with a 15-second limit per role, and caps the chat answer at 1,024 tokens or your lower INFERENCE_CHAT_MAX_OUTPUT_TOKENS. The result, ready or not, is kept in the running process for five minutes for the same configuration: a repeat in that window returns cached: true and calls no provider; checked_at and expires_at bound it. During those five minutes authenticated system_health shows it on the chat and embedding blocks: readiness: ready and evidence: inference for a role that answered.

    Refusals run nothing:

    Answer Meaning
    access_denied The session is signed in but does not hold the deployment operator role now. A newly granted role takes effect after you sign in again.
    HTTP 401 The request carried no valid browser session: it was not sent from the signed-in Portal tab, the session ended, or the CSRF header is missing or wrong.
    auth17_operator_unqualified The call came from an agent credential. Use the operator's browser session instead.
    not_applicable_in_local_mode The instance runs without authentication; the self-test is not available there.
  4. In a disposable space, with non-sensitive data, run the full journey: short_note, then mid_consolidate, then long_push, then long_query. mid_consolidate only queues a job: once it completes, the bank must contain the note, and the query must return the pushed content. Call long_status on the space: embedding_collection must not be reindex_required.

Troubleshoot

Symptom Cause Fix
Startup fails: legacy and split families must not coexist LLMAAS_* variables remain next to INFERENCE_* Remove every LLMAAS_* line, including empty ones, or go back to the complete legacy family
Startup fails: incomplete chat or embedding role A required variable of that role is missing or empty Complete the whole role, or remove all of its variables
Startup fails: unknown inference variable A misspelled INFERENCE_* name Correct the name; Hivemind never falls back to a default
system_health is degraded, a role shows connectivity: not_configured That role is not configured Add the complete role block and restart
Consolidation returns provider_unconfigured No chat role Configure the chat role and restart
Graph Memory startup fails and names the embedding byte ceiling variable The configured profile has no qualified capacity Set the variable named in the log (step 3) and restart
The self-test answers auth17_operator_unqualified or access_denied It was called with an agent credential, or by a session without the deployment operator role Run it from a deployment operator's signed-in Portal tab (Verify, step 3)
Health is ok but the self-test reports a role not_ready Credential, quota or model problem that discovery cannot see; a reasoning model may also spend its budget before answering Check the account and model with the provider, then rerun the self-test after the five-minute cache expires
Spaces report reindex_required after a change The embedding identity changed Keep writers stopped and run the bounded reindex; never delete the old collection
LONG extraction times out on a slow model Source chunks too large for the model's speed Qualify a smaller EXTRACTION_CHUNK_SIZE and check EXTRACTION_TIMEOUT_SECONDS, as described in extraction call sizing

When you ask for support, give the Hivemind version, provider and model names, the error category and a minimal synthetic reproduction. Never share a credential, a private endpoint or memory content.

Next