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 atAUTO_CONSOLIDATION_THRESHOLDeligible notes. A batch may need a correction call and up toCONSOLIDATION_TRANSIENT_RETRIESretries; calls can be billed even when they time out without reporting usage. - Automatic MID maintenance.
MID_AUTO_COMPACTadds chat calls to compact oversized bank files;MID_AUTO_ARCHIVEsends archived MID content into LONG, which costs extraction and embedding calls. - LONG ingestion. Each document costs extraction calls (more of them when
EXTRACTION_CHUNK_SIZEis smaller) and one embedding per chunk.TEMPORAL_OCCURRENCE_EXTRACTION=trueis experimental and costs more. - Queries. Every
long_queryembeds 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_testsends one bounded request per role. - Token budgets.
INFERENCE_CHAT_MAX_OUTPUT_TOKENScaps each chat response, including hidden reasoning on reasoning models.
What to have at hand¶
- Shell access to the host and its root
.envfile (mode0600). - 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¶
-
Choose the configuration family. New deployments use the split role families
INFERENCE_CHAT_*andINFERENCE_EMBEDDING_*. The legacyLLMAAS_*family remains supported through 1.x as one OpenAI-compatible endpoint shared by both roles. Never mix the two: anyINFERENCE_*variable selects the split family, and a remainingLLMAAS_*variable then stops startup. To move an existing deployment, follow the strict migration. -
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_TOKENSmust stay strictly belowINFERENCE_CHAT_CONTEXT_WINDOWand at most 1,000,000.INFERENCE_EMBEDDING_DIMENSIONSmust equal the vector length the model returns; it is never sent to the provider. -
Declare the embedding input capacity. Set
INFERENCE_EMBEDDING_MAX_INPUT_BYTESto a positive ceiling, in UTF-8 bytes, that you have qualified for your model, tokenizer and endpoint. Only theopenaiprovider withtext-embedding-3-small,text-embedding-3-largeortext-embedding-ada-002has 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 useLLMAAS_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, checkdocker compose logs graph-memoryusing the same Compose files. -
Set optional chat tuning only if you need it.
INFERENCE_CHAT_EFFORT(reasoning effort) is accepted only with theopenaiandopenai-compatibleproviders.INFERENCE_CHAT_TEMPERATUREis optional; the reference profiles omit it so the provider default applies. A configuration you compose this way is outside the reference profiles. -
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. -
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¶
-
Startup completes. A configuration error names the offending variables (never their values) and stops the service before any network access.
-
Call
system_healthwith any valid credential. With both roles reachable, the top-levelstatusishealthyandservices.llmaas.statusisok. This check only discovers models and spends no tokens; the self-test in step 3 exercises your credential, quota and model. -
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) receivesauth17_operator_unqualifiedwhatever its grants, and the Portal has no button for it. The self-test spends provider budget: run it under your cost policy.- Sign in to the Portal at
https://hivemind.example.orgas a deployment operator. Operator tools must show Configuration. -
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/toolover HTTPS, with the session cookie__Host-hivemind_sessionthat the browser attaches, the session's CSRF value (the__Host-hivemind_csrfcookie) in theX-Hivemind-CSRFheader, and the same-originOriginheader the browser adds. Never add anAuthorizationheader: the request would then be an agent call and be refused. -
Read the answer. HTTP
200carries the tool result:status: okandreadiness: readywhen both roles answered,status: errorandreadiness: not_readyotherwise.roles.chatandroles.embeddingeach giveconfiguredandreadiness, then, when known, the provider, the configured and resolved model, the expected and effective dimensions for embedding, token counts, anderror_categorywithretryablefor 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 returnscached: trueand calls no provider;checked_atandexpires_atbound it. During those five minutes authenticatedsystem_healthshows it on thechatandembeddingblocks:readiness: readyandevidence: inferencefor a role that answered.Refusals run nothing:
Answer Meaning access_deniedThe 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 401The 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_unqualifiedThe call came from an agent credential. Use the operator's browser session instead. not_applicable_in_local_modeThe instance runs without authentication; the self-test is not available there. - Sign in to the Portal at
-
In a disposable space, with non-sensitive data, run the full journey:
short_note, thenmid_consolidate, thenlong_push, thenlong_query.mid_consolidateonly queues a job: once it completes, the bank must contain the note, and the query must return the pushed content. Calllong_statuson the space:embedding_collectionmust not bereindex_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.