Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Model Settings and Replay

The engine needs no model server. A host needs these settings only for live calls such as _llm and dialogue wording and judging. Set them in the environment of the Python process.

Local model

With Ollama installed and running:

ollama pull gpt-oss:20b
export FRAMEX_MODEL_PROVIDER=ollama
export FRAMEX_MODEL=gpt-oss:20b
export FRAMEX_MODEL_ENDPOINT=http://127.0.0.1:11434
python -m framex.tools extraction.fx --receipts-out extraction.receipts.fx

Use the grounded extraction program as extraction.fx. Model choice and memory determine whether a local run is practical. The example’s deterministic tests need no model.

Hosted or compatible server

Use the model ID and full chat-completions URL supplied by your provider:

export FRAMEX_MODEL_PROVIDER=openai
export FRAMEX_MODEL=your-model-id
export FRAMEX_MODEL_ENDPOINT=https://your-provider.example/v1/chat/completions
export FRAMEX_MODEL_KEY_ENV=OPENAI_API_KEY

Set OPENAI_API_KEY using your own secret configuration. The host reads it from the variable named by FRAMEX_MODEL_KEY_ENV; keys do not enter receipts. Keep them out of .fx programs, prompts and source control. If your project uses .env, load it into the process environment yourself; FrameX does not automatically load .env files.

Settings reference

VariableMeaning
FRAMEX_MODEL_PROVIDERollama (default) or openai
FRAMEX_MODELModel identifier; defaults to local for Ollama or gpt-5-mini for the compatible provider
FRAMEX_MODEL_ENDPOINTOllama base URL or full compatible chat-completions URL
FRAMEX_MODEL_KEY_ENVKey variable name, default OPENAI_API_KEY
FRAMEX_MODEL_CACHEAnswer store, default ~/.cache/framex/model
FRAMEX_MODEL_REFRESH1 asks again instead of replaying
FRAMEX_MODEL_TIMEOUTModel-call timeout in seconds, from 1 to 600
FRAMEX_MODEL_SCHEMA0 disables provider JSON-schema constraints
FRAMEX_MODEL_JSON_EXTRACT1 opts into extracting JSON from surrounding text; evidence marks json_extracted
FRAMEX_MODEL_RESPONSE_FORMATjson_object (default) or none
FRAMEX_MODEL_THINKtrue or false for Ollama and supported local compatible servers
FRAMEX_MODEL_MAX_TOKENSPositive output-token limit for the compatible provider
FRAMEX_MODEL_HTTP_HOSTPermits plain HTTP to one named model host, in addition to loopback

Keep provider-specific overrides unset unless your endpoint supports them. Response-format settings do not replace acceptance rules.

Three different records

RecordContentsUse
Model-answer cacheProvider, model, messages, timestamp, output and provider evidenceReplay an identical request without a live call
Episode receiptsTool-result facts linked to request identitiesRecompute conclusions offline with the original program
Client.transcriptAttempted engine protocol requests, including rejected onesExport with save_replay

Cache identity includes provider, model and messages; an explicit THINK setting also affects it. A different prompt or model can cause a live call. Events mark evidence as mode: "live" or "replay". Retain source programs and receipts alongside the cache to reproduce a decision.

Test failure paths with authored receipts. Provider failure, malformed JSON, an unclear judgment and a logical unknown must keep distinct meanings; see Foundations.