Malspark

LLM providers

Anthropic

Settings for the anthropic provider.

The anthropic provider calls Anthropic's Messages API through LangChain's ChatAnthropic. Every request it sends is one the current Claude models take, Claude Haiku 5.5 (claude-haiku-5-5) included.

Settings

SettingDefaultNotes
core.llm.provideropenaiSet to anthropic.
core.llm.anthropic.api_key—Required; the provider refuses to build a model without it. Stored encrypted.
core.llm.anthropic.base_urlemptyWhere every Anthropic request goes — a job's calls, the Models API question and the connection test — written without /v1: a proxy, or the loopback stub of a rehearsal. The API key is sent to this address with every request, so https is required unless the host is loopback (127.0.0.0/8, ::1, localhost), or a Docker host gateway when core.llm.anthropic.allow_plain_http_to_docker_host is on; a user name, a query, a fragment or a /v1 ending is refused on save. Empty is the Anthropic API.
core.llm.anthropic.allow_plain_http_to_docker_hostoffAlso takes a plain-http base URL on a Docker host gateway (host.docker.internal, gateway.docker.internal, 172.17.0.0 to 172.31.255.255), the address a containerised worker reaches a stub or proxy on the host by. The API key then crosses that hop in clear text, and those names and addresses can be another machine on a LAN that uses 172.16.0.0/12: turn it on only for a rehearsal stub on this host.
core.llm.anthropic.expert_modelclaude-sonnet-4-20250514The analysts' model. Name the model you run, such as claude-haiku-5-5.
core.llm.anthropic.judge_modelclaude-sonnet-4-20250514The judge's model.
core.llm.anthropic.effortemptySent as output_config.effort on every request: low, medium, high, xhigh or max. Empty sends nothing and keeps the model's own default (medium on Claude Haiku 5.5).
core.llm.anthropic.prompt_cache_ttl5mHow long the prompt cache keeps what a request writes: 5m, or 1h, which costs more to write.
core.llm.anthropic.pack_cache_ttl1hHow long the prompt cache keeps the triage pack at the head of an agent's turn, behind a breakpoint of its own, so a later debate round reads it: 1h, 5m, or off. Never shorter than prompt_cache_ttl.
core.llm.provider               = anthropic
core.llm.anthropic.api_key      = <your key>
core.llm.anthropic.expert_model = claude-haiku-5-5
core.llm.anthropic.judge_model  = claude-haiku-5-5
core.llm.anthropic.effort       = max

How it behaves

  • One endpoint for every agent. A per-agent entry on anthropic takes no base_url, and one set is rejected on save; core.llm.anthropic.base_url moves every Anthropic request at once, and a probe is filed under that address.
  • Sampling parameters. Claude Haiku 5.5 and the other models of its generation refuse a non-default temperature, top_p or top_k with a 400. The vendored model table's fixed_sampling rows name those models, each with the page that documents it (the Models API states no such capability), and such a model is sent no sampling parameter. Any other model is sent the temperature it is built with.
  • Thinking. The provider configures none: a model that thinks by default thinks as it would, and no budget_tokens is ever sent. How deep it goes is the agent entry's own effort (llm.agents.<key>.effort), else core.llm.anthropic.effort. A level the Models API says the model does not take refuses the job before it starts.
  • Window and output cap. The window probe asks the Anthropic Models API (GET /v1/models/{model}, free, and only with a key) for the model's max_input_tokens and max_tokens, and the run summary names it as the source ("the Anthropic Models API reported 1,000,000 tokens"). A derived output cap is the smaller of a quarter of the window and that maximum (128,000 on Claude Haiku 5.5). When the API cannot be asked, the vendored table's row answers and the summary says so.
  • Streaming. A request whose output cap is past what the Anthropic SDK sends unstreamed by its own rule (over 21,333 tokens) is streamed and joined into the same answer, so a long answer never sits on an idle connection.
  • Prompt caching is asked for only where a prefix is sent again. A tool loop's first request carries a breakpoint on its task turn (sent as a one-block list on every request of the loop, so its shape never changes), and every later request carries two: on the last block of its newest user turn, written now and read next step, and on the turn the previous request ended with, so the read is always found. A single-shot call (a report section, a revision, a verdict) carries none and pays no write premium. The run summary counts the input read from the cache and the input written to it.
  • The history only grows. A thinking block is bound to everything sent before it, and an account created on or after 2026-08-31 gets a 400 for an edited prefix. On a model documented so (the vendored table's prefix_bound_thinking rows, Claude Haiku 5.5 among them):
    • the newest turn ends with the whole current run-state block, as on every other provider, and no message is ever sent with a system role; every earlier user turn is sent again exactly as it was sent, with the block it carried then. Those earlier copies are counted in the window, room and spend measures of every request (about one block a step, read from the cache). Only the exact block the platform attached is recognised; text that merely ends with the markers is sent as written;
    • an assistant turn is sent as it was received: a call the clock ended before it ran, or whose arguments never parsed, is answered with a reply saying it was not run rather than taken off its turn;
    • the final-answer nudge and the forced synthesis keep the loop's system prompt and tools and send tool_choice: {"type": "none"};
    • where a history is still changed (a salvage cut to fit), every thinking block goes back as received once and the request asks the API to drop the ones whose prefix changed (block_binding: drop_block, beta thinking-binding-controls-2026-08-01), the documented recovery; later requests leave the dropped blocks out, so the reasoning written after them stays.
  • No forced tool choice, no prefill. Structured output offers the schema's tool without forcing it, and an answer that calls no tool is asked again in text. Malspark's requests end on a user turn; a request that ended on an assistant turn (a prefill, which a thinking model refuses) would be named in the log.
  • Tool replies. A turn's tool_use blocks are each answered by a tool_result block at the front of the next user turn, as the API requires; a call the history left unanswered gets a reply saying none was recorded.
  • Hosted, so parallel. Under core.llm.parallel_analysts = auto, the Anthropic API counts as hosted, so a stage's analysts run at once.
  • Request timeout. 1800 s until the model's pace is measured, then sized per request.

Spend

With core.llm.max_spend_usd_per_job set, a call is charged its reported usage at the vendored table's documented prices, unless core.llm.model_prices names the model. Claude Haiku 5.5 is priced by prompt length, each request on its own: $0.10 input, $0.01 cache read, $0.125 five-minute and $0.20 one-hour cache write and $0.50 output per million tokens for a prompt up to 100,000 tokens, and $0.50, $0.05, $0.625, $1 and $2.50 for a prompt over it, the prompt counted whole, cache reads and writes included (pricing). A price row in core.llm.model_prices takes the same fields: cache_write_input_usd_per_mtok, cache_write_1h_input_usd_per_mtok and tiers, each tier with its over_prompt_tokens.

The connection test asks through /v1/messages with the configured effort, and a model that answers only with a thinking block has answered. A per-agent entry may put one agent on Anthropic while the rest run elsewhere; see Per-agent models and fallbacks.

Edit on GitHub

On this page