Notizen / 14
Strix on a custom gateway: one base URL, five consequences
Strix has no provider drop-down to bend; its LLM layer is LiteLLM, so "point it somewhere else" is one variable and five consequences. This is the configuration for a custom OpenAI-compatible gateway: which model-name prefix selects the OpenAI adapter, why LLM_API_BASE alone does not move Strix off /v1/responses, how to make its cost reporting match a two-window price sheet, the one integer its cache accounting needs for a DeepSeek backend, and the two timers whose defaults outlast the ceiling of the gateway in front of them. It ends with a copy-paste block, a four-command verification, and the part no environment variable fixes.
One variable does the work; four decide whether its numbers mean anything
Strix's model is a string in LiteLLM's provider/model form, and the prefix selects the adapter. For an OpenAI-compatible endpoint the prefix is openai/, and everything after it is an id your endpoint actually serves — that string travels in the model field of the request body:
export STRIX_LLM="openai/deepseek-chat"
export LLM_API_KEY="sk-live-..."
export LLM_API_BASE="https://api.tokenaimodels.com/v1"
Three variables, and a request leaves the machine. What they do not give you is a scan whose report you can trust, because Strix's defaults assume a provider it can price, a catalog it can read, and a server that waits as long as it does. LLM_API_BASE is documented to accept OPENAI_API_BASE, LITELLM_BASE_URL or OLLAMA_API_BASE as aliases, so a leftover export from another tool can win silently — print what Strix resolves before debugging anything else.
The model id is the first place a gateway differs from a provider. GET /v1/models on your endpoint is the authoritative list; on this platform it returns deepseek-chat, deepseek-chat-lite and deepseek-reasoner. If you put an id there that your endpoint does not serve, the failure arrives as a 404 or a model not found inside an OpenAI-shaped error envelope, at scan time, not at startup.
The trap: a custom base URL does not change the API path
Strix can call a model over either /v1/responses or /v1/chat/completions. The default is decided by LiteLLM's model catalog: responses when the catalog lists /v1/responses for that model, chat_completions otherwise. And the documentation is explicit about the part that matters here — a custom LLM_API_BASE does not change this choice. Point the base URL at a gateway that only serves /v1/chat/completions and the base URL alone will not save you:
export STRIX_API_TYPE="chat_completions" # alias: STRIX_FORCE_API
Two reasons to set it even when it looks redundant. A custom id is normally absent from the catalog and therefore already falls back to chat completions — but a catalog update, or reusing a well-known model name as a stand-in for your own, can move you onto a path your gateway does not implement. And the symptom is unpleasant: a 404 on a POST to /v1/responses, from a request you never wrote, on the second turn of a scan. The flag applies to bare and openai/ model names alike.
There is a second gateway-shaped variable worth knowing before you start: LLM_EXTRA_HEADERS takes a JSON object sent on every LLM request, for endpoints that route or attribute by header rather than by key. The bearer token still comes from LLM_API_KEY; this only adds to it. Use it if your gateway needs a tenant or feature header, not as a replacement for auth.
Three cost numbers that replace a report, not a bill
STRIX_LLM_INPUT_COST_PER_MTOK, STRIX_LLM_OUTPUT_COST_PER_MTOK and STRIX_LLM_CACHED_INPUT_COST_PER_MTOK exist for exactly this case — the documentation's own words are "gateway or self-hosted model ids that LiteLLM can't price". Two properties, both easy to get wrong:
- Setting any of the three replaces the provider-reported and LiteLLM cost for that model in reports and in
--max-budgetarithmetic. - An unset input or output price counts as 0, so set both. Set one and your run report will confidently tell you the scan was free.
What these numbers control is what Strix *believes* it spent. They do not change what the gateway charges: metering happens per request on the server, from the usage block in the response. The variables exist so that the client-side budget guard and the server-side balance agree about how close to the edge you are.
Which makes the number you paste a decision, not a formality. Rates on this platform come in two windows — peak and off-peak, peak higher, applied by wall-clock hour rather than by request. Strix's three variables are flat. A flat number cannot express two windows, so take the higher of the two, from the rates table at /pricing, and paste it into all three. A --max-budget computed from the peak rate stops early during off-peak hours, which costs you a scan; one computed from the off-peak rate overspends during peak without ever tripping. Deliberately over-estimating is the safe direction, and it is the only direction these three variables let you take.
The one integer DeepSeek's cache needs
STRIX_CACHE_BLOCK_TOKENS defaults to 128 — the block size providers cache prompts in. The documentation names the exception directly: "DeepSeek and GLM use 64; vLLM defaults to 16."
export STRIX_CACHE_BLOCK_TOKENS=64
Leave the default on a DeepSeek-backed endpoint and a turn whose prompt grew by 40 tokens gets logged as a cache miss when the cache actually hit. The run report's cache-hit ratio becomes fiction in the pessimistic direction, and you will spend an afternoon trying to fix prefix stability in a prompt that was stable all along. This setting changes accounting only; it does not alter a single request.
Two timers, both longer than the ceiling in front of them
LLM_TIMEOUT defaults to 300 seconds. The gateway in front of it may close the connection first — on this platform the upstream call is aborted at 280 seconds and the request ends there. With defaults, the client waits 300 for an answer to a request that died twenty seconds earlier, and the error surfaces as a broken connection rather than as the timeout Strix knows how to handle:
export LLM_TIMEOUT=240
Set it *below* the server's ceiling rather than equal to it. A timeout Strix owns is a request it can retry or re-plan; a socket that resets under it mid-scan is not. Reasoning models make this concrete: a turn that thinks for minutes before its first token is inside the server's ceiling and outside a short client timeout, so measure time-to-first-token once and set the value from that number.
The second timer is LLM_PREFLIGHT_TIMEOUT, default 30 seconds — the startup connection check that fails the run with LLM CONNECTION FAILED. Scan requests use LLM_TIMEOUT; the preflight uses this one. A model that queues during peak hours can exceed 30 seconds on the check alone, and the failure looks like a wrong key when the key was never wrong. Raise it before you rotate anything.
Retries, and the two failures that are not transient
STRIX_LLM_MAX_RETRIES defaults to 5. On a prepaid gateway two error classes make retries pointless in a specific way: 402 (balance too low, or a pre-authorisation sized from a large max_tokens that exceeds what is left) and an insufficient_quota-style rejection of the key itself. Neither clears on the sixth attempt, and both have exactly one fix — top up, or ask for less. 429 is different: it carries retry-after for a fixed window, so honouring the header beats an exponential backoff that retries into the same wall. Two retries covers genuine transport hiccups without turning one balance error into six log lines.
Put the cheap task on the cheap tier
Finding deduplication inside Strix is a structured classification, and by default it runs on the main model. STRIX_DEDUPE_MODEL moves it:
export STRIX_DEDUPE_MODEL="openai/deepseek-chat-lite"
LiteLLM routing means it rides the same LLM_API_BASE and the same key; DEDUPE_LLM_API_BASE exists only for the case where the dedupe model lives somewhere else. Two caveats straight from the documentation: a dedicated dedupe model never inherits LLM_EXTRA_HEADERS or LLM_EXTRA_BODY, so it needs DEDUPE_LLM_EXTRA_HEADERS / DEDUPE_LLM_EXTRA_BODY if your endpoint requires them; and a separate STRIX_DEDUPE_MODEL keeps its LiteLLM price, which means the three STRIX_LLM_*_COST_PER_MTOK variables do not cover it — an id LiteLLM cannot price stays unpriced in the report. Compare the tiers on /models/deepseek-chat and /models/deepseek-chat-lite before picking which one does the cheap work.
The block, in full
# Required: model id your endpoint serves, key, base URL
export STRIX_LLM="openai/deepseek-chat"
export LLM_API_KEY="sk-live-..."
export LLM_API_BASE="https://api.tokenaimodels.com/v1"
# A custom base URL does not switch the API path — force it
export STRIX_API_TYPE="chat_completions"
# Report and --max-budget arithmetic: use the HIGHER of the two windows,
# copied from https://tokenaimodels.com/pricing (all three, or the rest count as 0)
export STRIX_LLM_INPUT_COST_PER_MTOK="<peak input rate>"
export STRIX_LLM_OUTPUT_COST_PER_MTOK="<peak output rate>"
export STRIX_LLM_CACHED_INPUT_COST_PER_MTOK="<peak cached input rate>"
# DeepSeek caches prompts in 64-token blocks
export STRIX_CACHE_BLOCK_TOKENS=64
# Stay under the gateway's own 280-second ceiling; give the preflight room
export LLM_TIMEOUT=240
export LLM_PREFLIGHT_TIMEOUT=90
# Classification work on the entry tier
export STRIX_DEDUPE_MODEL="openai/deepseek-chat-lite"
# Optional: per-request timings in run.json (llm_requests, tool_calls)
export STRIX_RUN_RECORD_TIMINGS=true
Strix also reads a config file — ~/.strix/cli-config.json with an env object, or strix --target ./app --config /path/to/config.json — which is the better place for this block once it works. Putting it there also removes the aliasing risk: a stray OPENAI_API_BASE in a shell profile stops being able to outrank LLM_API_BASE.
Four checks, in this order
curl -s https://api.tokenaimodels.com/v1/models -H "Authorization: Bearer $LLM_API_KEY"— the id afteropenai/must appear in the list. This one call separates a model-name problem from everything else.- Run one small scan. The preflight happens here, not in step 1.
LLM CONNECTION FAILEDis the preflight timing out or the key being rejected; a 404 is the API type; a 402 is the pre-authorisation. - Read
strix_runs/<run_name>/run.json. WithSTRIX_RUN_RECORD_TIMINGS=trueit carriesllm_requestsandtool_callstimings, which is where you find out whether the timeout is the client's or the server's.events.jsonlin the same directory is the local telemetry, written whether or not remote OTEL export is configured. - Compare the run's token count against your gateway's own usage log. They should agree on the same request. If Strix's number and the server's number differ, the cost variables are being applied to a different shape than you think — and that difference is what
--max-budgetwill act on for the rest of the scan.
What no environment variable fixes
A gateway is transport. It changes where requests go, what they cost and what your logs can prove. It does not change whether a model will do the work. The Strix documentation is blunt about this for OpenAI models — security testing with them needs Daybreak (Trusted Access for Cyber), and without it "the models refuse most offensive tasks". The same caveat travels with every model at every endpoint: refusal behaviour belongs to the model, not to the base URL, and a refusal on an offensive step is not a misconfiguration that another variable will clear. Run one small scan before you budget a large one, and treat a model that declines as a routing decision about which model to point at, not as a gateway bug.
Rates and both pricing windows live at /pricing; the endpoint reference — hosts, error envelope, request ceiling — is in /docs; a key is at /signup.
Modelry betreibt eine Plattform, die DeepSeek-Modelle hinter einem HTTP-Endpoint bereitstellt; vorausbezahlte Credits und Steuern werden beim Kauf vom Merchant of Record abgewickelt, und die Datenaufbewahrung ist dokumentiert. Starten Sie mit $0.50 Testguthaben: Schlüssel erstellen.