Provider-neutral LLM requests, transcripts and responses, I/O-free
README.md

llm #

Provider-neutral values for one turn with a language model, an
OpenAI-compatible chat-completions client and proxy for Eio, and the
fireworks and mistral commands, which chat with the models Fireworks AI
and Mistral AI serve and rewrite named sections of a Markdown document, and
llm-proxy, which serves those models and a local server's to clients that
hold no key, under a budget of tokens or of US dollars.

llm holds checked, inert values: transcripts, requests with their options
and tools, streamed events, terminal responses, token usage, classified
errors and the record of a call kept in a call log, each with a
JSON codec, and the agent loop as a pure state machine. It
performs no I/O. A client is an injected interpreter, so a test or another
transport supplies its own.

llm-eio interprets requests against any server that speaks the
OpenAI Chat Completions
protocol, over requests-eio. It streams the reply as server-sent events,
retries a failed request within a bound (honouring the server's
Retry-After), re-runs a broken stream only while no output has been shown,
and classifies failures by HTTP status and the error body. Llm_eio.Fireworks
points it at Fireworks AI
and lists the models an account serves; Llm_eio.Mistral points it at
Mistral AI and lists the models a key may use.

Llm_eio.Chat_server is the server side of the same protocol: it decodes a
request body into an Llm.Request.t, the inverse of what the client sends,
and encodes a response, its streamed events and an error back.
Llm_eio.Proxy serves it over HTTP/1.1 (respond-eio) and answers each call
through the client of the upstream that serves its model, which holds the
provider's key or, for a local server, none. Its decisions are Llm.Proxy's,
with no I/O: a model is routed to one upstream; a call is counted against the
job its bearer token names, a token that means nothing to any provider; its
ceiling (its body's bytes and its output cap, an unrepresentable sum refused
before admission) is debited from the job's and
the grant's budgets before it is sent, and settled from the usage the
provider reports. A request naming a model off the list, naming no job, or
past a budget is refused before any call, and each call's record is built
from the request decoded, which never held the key, with its job and grant.

Llm_eio.Relay forwards native Messages or Responses requests to a
credential-holding upstream. The caller selects the protocol and supplies
credential headers through decide; client credentials and hop headers are
removed. Request bodies, response bodies and rate-limit headers pass through,
including streaming events. Messages follows Anthropic's gateway
guide
; Responses serves
/v1/responses. A Responses call on the priority tier (service_tier
priority, or Codex's fast) keeps it only when its x-agent-priority
header is 0, a job on a P0 issue; any other goes on the standard tier, the
member removed, and the relay logs it (Llm.Proxy.Tier). A caller's
answered reads each response's head.
claude-x relay (ocaml-claude) selects Messages.

Mistral's schema refuses any member it does not name, so a
Chat_completions.Dialect says how a request is spelled for it: an earlier
turn's reasoning goes back as thinking chunks of the assistant content,
never as reasoning_content; a tool-call id that is not nine letters or
digits, which some Mistral models refuse, is sent as one that is, the same in
the call and its result; and reasoning_effort takes all seven levels, from
none to max, a model refusing those it does not support. Its streams carry
thinking and text chunks in an array content, tool calls whole and without
an index, and arguments as an object, all of which the client reads.

Security #

Sending text to Fireworks or Mistral publishes it to a third party. Both
commands refuse a file (a prompt, a system prompt, a JSON schema, rewriting
instructions or a document) that lives in a git repository whose remote
belongs to a private owner, including a local clone of one, unless
--allow-private is given. run and eval check the directory the model
works in the same way, since the model may read any file under it.

run confines the model to its directory: an absolute path, a ..
segment, a symlink out of it, a .git entry and a file named like a secret
(.env*, *.key, *.pem, id_rsa* and the like) are refused.
--read PATH=ROUTE lets the model read the tree the link at PATH leads
to, such as a dependency's checkout: the link is resolved once, at the
start, every path under PATH is confined to that tree in the same way,
and a write there is refused with an error that ends with ROUTE, how a
change there is made instead. A command
is an argument vector the caller allows by prefix (--allow 'dune build'),
never a shell string, and no argument the model adds may start with -; it
runs without the variables whose names hold KEY, TOKEN, SECRET or
PASSWORD. Without --unattended each write and each command is asked on
the terminal first. On macOS, --sandbox-profile FILE runs each command,
Git's included, under that Seatbelt profile (sandbox-exec -f FILE), so what
a command reads and writes outside the directory is the profile's to allow.

The API key is sent only as an Authorization: Bearer header and never
printed: -v names where the key came from, not the key. A key file that its
group or others may read is refused, with the chmod that fixes it.

Install #

opam install llm-eio

Usage #

Library #

A request is built and checked without a network:

# let model = Llm_eio.Fireworks.model "accounts/fireworks/models/glm-4p6" ;;
val model : Llm.Model.t = <abstr>
# let transcript = Llm.Transcript.of_list_exn [ Llm.Message.user_text "Hello" ] ;;
val transcript : Llm.Transcript.t = <abstr>
# let request = Llm.Request.v_exn ~model transcript ;;
val request : Llm.Request.t = <abstr>
# Llm.Model.id (Llm.Request.model request) ;;
- : string = "accounts/fireworks/models/glm-4p6"

Sending it with the Eio client:

let reply request =
  Eio_main.run @@ fun env ->
  Eio.Switch.run @@ fun sw ->
  let clock = Eio.Stdenv.clock env in
  let session =
    Requests_eio.v ~sw ~mono:env#mono_clock ~clock (Eio.Stdenv.net env)
  in
  let credential =
    Llm_eio.Chat_completions.Api_key.v (Sys.getenv "FIREWORKS_API_KEY")
  in
  let client = Llm_eio.Fireworks.client ~session ~clock ~credential () in
  match Llm.Client.response client request with
  | Ok r -> print_endline (Llm.Response.text r)
  | Error e -> prerr_endline (Llm.Error.message e)

Llm.Client.response ~on_event sees the reply's text as it streams, the
token usage, and each retry before it is made. Llm_eio.Mistral.client is
built the same way, from Llm_eio.Chat_completions.Api_key.v, for a model
such as Llm_eio.Mistral.model "mistral-small-latest".

Agent loop #

Llm.Agent is a tool-using loop as a pure machine: Agent.v gives the
first request, and Agent.incoming takes each response, tool result or
provider failure and answers what is owed next: a request, the tool calls
to perform, or the stop. The model answers by calling final_answer, whose
input schema is the caller's and which the machine validates; the run is
bounded by a Budget.t of requests and tokens, a cached input token
weighed at its price over the uncached one
(Llm_eio.Profile.cached_input). Once the bounds leave at most three
more requests, a note in the transcript says how many, once a run. At a
bound the machine asks once more,
for final_answer only, and marks that answer incomplete. Agent.run drives it
through a client and a function performing one call, and
Llm_eio.Workspace is such a function: six tools over one directory.

let solve ~process ~clock ~client ~model root =
  let workspace =
    Llm_eio.Workspace.v ~process ~clock
      ~allow:[ Llm_eio.Workspace.Allow.v [ "dune"; "build" ] ]
      root
  in
  let answer =
    Json.Value.of_string_exn
      {|{"type":"object","properties":{"line":{"type":"integer"}},"required":["line"]}|}
  in
  let profile = Llm_eio.Profile.of_model model in
  match
    Llm.Agent.v ~model ~prelude:(Llm_eio.Profile.prelude profile)
      ~options:(Llm_eio.Profile.options profile)
      ~tools:(Llm_eio.Workspace.tools workspace)
      ~answer
      ~budget:
        (Llm.Agent.Budget.v ~steps:20 ~tokens:200_000
           ~cached:(Llm_eio.Profile.cached_input model))
      "Find the line that calls List.fold_left in a.ml."
  with
  | Error (`Msg m) -> Error m
  | Ok start ->
      let _, stop =
        Llm.Agent.run ~client ~perform:(Llm_eio.Workspace.perform workspace)
          start
      in
      Ok stop

Llm_eio.Profile.of_model is the system prompt and options a model's own
agent harness uses (Mistral Vibe for mistral-large-4, Kimi CLI for Kimi
K3, the vendors' guidance for GLM 5.3, DeepSeek V4 and gpt-oss), each value
cited in its source.

A person watching a run may say something to the model between two steps:
Agent.incoming takes Said text, owes nothing on it, and the next request
carries it after the results of the calls in flight; an answer the model
gave before it saw the message is not taken, and the model is asked again.
Agent.run ~said polls the messages before each action. Llm.Session is the
run as lines, one JSON object each: its events (Session.Event.of_action
and of_input, from Agent.run's on_action and on_input) and a
person's messages (Session.Input).

Command line #

The fireworks and mistral commands take the same subcommands and options.
The key is read from --key-file PATH, then from FIREWORKS_API_KEY or
MISTRAL_API_KEY, then from $XDG_CONFIG_HOME/fireworks/token or
$XDG_CONFIG_HOME/mistral/token (by default under ~/.config), which must
have mode 0600. A Fireworks model is named by its resource name or, for the
serverless catalogue, by its last segment; a Mistral model by its id.

$ fireworks chat -m kimi-k2-instruct "Name three moons of Jupiter."
$ fireworks chat -m glm-4p6 --system-file style.md -f draft.md --json
$ git log -1 --format=%B | fireworks chat -s "Shorten this commit message."
$ fireworks models
$ fireworks rewrite -m qwen3-235b-a22b --instructions style.md \
    --in README.md --section Overview --section Usage --out README.new.md
$ mistral chat -m codestral-latest "Write an OCaml function reversing a list."
$ mistral chat -m mistral-small-latest --reasoning-effort high "What is 17*23?"
$ mistral chat --json-schema book.schema.json "A classic French novel."
$ mistral models

chat prints the reply as it streams, or the whole response with --json,
and the token usage on standard error; no price table is read, so no cost is
estimated. --json-schema FILE asks for a reply valid against that JSON
Schema, and --reasoning-effort LEVEL for an effort the provider takes:
Fireworks takes low, medium and high, and refuses any other before
sending.

rewrite sends each named section, heading and body, with the instructions,
and nothing else of the document. It writes a copy in which only those
sections' bodies changed, and refuses the result when a reply alters a fenced
code block of its section byte for byte, adds a heading at the section's level
or higher, or leads to any change outside the named sections.

--base-url URL sends the requests to another OpenAI-compatible server.

usage prints what the provider reports to the key: a table, or with
--json the list usage --json of the account commands prints,
each limit with a period as a window with its share used, followed by every
figure as it was read, under the API's names. fireworks usage reads each
account's suspendState, its deployments and each quota's usage, value and
maxValue, among them monthly-spend-usd, the month's spend against the
monthly spend limit
(List Accounts,
List Deployments,
List Quotas).
mistral usage -m MODEL reads the limit and remaining of the tokens and
requests per minute the model allows, from the rate-limit headers of one call
capped at one output token. A figure no endpoint exposes says so: neither API returns a
prepaid balance, Mistral's spend and spending limit are its Admin API's, which
takes an Enterprise admin key, and neither states when a limit resets.
--call-log FILE adds what llm-proxy's call log records as spent through the
proxy, per grant, in tokens.

$ fireworks usage
$ mistral usage -m mistral-small-latest -m mistral-large-latest --json
$ fireworks usage --call-log /var/lib/mq-model/calls.jsonl

run gives the model a brief and tools over a directory, performs the calls
it makes, and prints the answer it submits as JSON; each call is shown on
standard error, then the requests and the tokens spent. It stops at the
answer; at --max-steps requests or the --budget of tokens, after asking
once for the answer so far, which it prints; on a second
reply in a row cut at --max-output-tokens, or on a provider failure, and
exits 0 only on an answer. A provider failure that says the service is
unavailable (no key or the key refused, the server refused or unreachable, a
timeout, a server error: Llm.Error.unavailable) exits 69, EX_UNAVAILABLE of
sysexits(3), so a caller can route its next run elsewhere. --answer-schema FILE is the answer's JSON
Schema. --generic replaces the model's profile with one common to all.
--commit keeps the work of a run in a Git worktree whatever stopped it
(Llm_eio.Workspace.keep): what the model changed and did not commit
itself, tracked files and the new files Git does not ignore, becomes one
commit whose subject is the answer's first line, cut to 72 bytes, or names
why a run with no answer stopped; a run that leaves a commit on its branch
exits 0. --events makes the run a session (Llm.Session): each event is
one JSON line on standard output, the last the stop with its answer, and
each line {"type":"message","text":TEXT} on standard input is a person's
message, sent with the next request; the brief is then BRIEF or -f.

$ mistral run -m mistral-large-4 --dir . --allow 'dune build' \
    --allow 'dune test' --unattended "Make the failing test pass."
$ fireworks run -m glm-5p3 --answer-schema folds.schema.json \
    -f brief.md --dir src

attach -- TRANSPORT... watches and steers such a session: it runs
TRANSPORT, draws each event it writes (the brief, each request, the model's
text and usage, each call and its result, each message heard, the stop), and
sends each line typed on its standard input as a message. It exits with
TRANSPORT's status. TRANSPORT is any command that speaks the session's lines:
mq attach NAME --take for a session on a worker, or cat over a recorded
trace.

$ mistral attach -- mq attach fleet/blacksun-42 --take
$ fireworks attach -- cat trace.jsonl < /dev/null

eval runs the agent on cases and grades each trial in code. A case is a
directory holding case.json and either tree/, copied fresh for each
trial, or a base commit of the repository given with --repo, checked out
in a detached worktree with the case's case.patch applied, so that a defect
the tree has fixed is put back for the trial. case.json gives the brief,
the answer schema, and optionally the task the case stands for
(triage, mechanical, security or design), context (files of the tree
appended to the brief), expect (a JSON Schema the answer must satisfy),
allow, check (a command that must succeed in the tree afterwards),
steps and tokens. It prints each trial as a JSON line carrying its
task, then per case the passes, the mean input and output tokens, steps and
seconds. The package's own cases are in eval/, at least three per task:
a security case names a defect at a place (an unchecked sum, a read past its
bound, a credential logged) and is graded by the tests that pin its fix; a
design case states a problem whose way out the tree decided, at a named
place, takes that decision back out and is graded by the tests that pin it,
left as they were; a triage case states a finding and is graded on whether
it is real and where it belongs.

$ mistral eval -m mistral-large-4 --repeat 3 --trials trials.jsonl eval/*

llm-proxy answers POST /v1/chat/completions, POST /v1/messages and GET /v1/models on an
address, for the models named and no other, each sent to its upstream:
mistral and fireworks with the key their own commands read, and any other
name an OpenAI-compatible server that takes no key, such as a local
llama-server, at the URL given, whose models a call names by their id
or as local:ID. Each call is counted against the job its
Authorization: Bearer token names and spends under one grant: --budget
tokens for every job together and --job-budget for each, or --budget-usd
and --job-budget-usd US dollars, its ceiling debited before the call and
settled from its usage; or no budget, for an account its provider bounds, as
a subscription's windows do: that grant refuses no call for what it has
spent, counts the tokens every job spends, and a provider's refusal, a 429
or a usage limit, reaches the job with the provider's status and reason.
Under dollars a call's ceiling is its body's bytes at
its model's dearest input price and its output cap at its output price, and
it settles at the price of each token its usage reports; the prices are
those Fireworks and Mistral list (Llm_eio.Profile.price), and a model
with none, a local one included, is refused with model_unpriced. With --budget-window SECONDS both budgets renew at each window of that length counted from the
epoch (86400 for each UTC day), a call still in flight keeping its ceiling in
the window that settles it; without it, they hold for the whole call log.
GET /api/health reports the grant's measure, tokens or pico_usd, and,
for a grant with a budget, its quota and what is remaining in it, and
the window and the seconds until it renews, reset, as the RateLimit fields
name them. A request with no
max_tokens is sent with --max-output-tokens (32768) or the largest cap
whose ceiling its job has left, whichever is less. With --call-log, each record carries the job and
the grant, and the records of the grant already in the log are counted at the
start, so a restart spends nothing twice. With --budget-window, a record
of a later window than the log's seals it first: the log is moved to
FILE.sealed/START.jsonl, START the Unix second its window starts, and
FILE opens again with the pending record of each call still in flight,
which counts what the whole log would. So a start reads one window's
records, however many calls the log has seen; a grant with no window holds
for its whole log and is never sealed. A seal a crash interrupts leaves
FILE.next, the next log written whole, which the start puts in place of a
FILE that is gone and drops beside one that is still there. A request member the request values
cannot carry (n, stop, top_p and the rest) is refused, naming it. What
a client can make it spend: a decode linear in the body, held whole up to
--max-body bytes (4 MiB) and refused beyond; one call at a time per
connection, at most --max-connections (16); and upstream, the tokens the
grant holds, which any client that reaches the proxy may spend under any job
name, or, under a grant with no budget, what the provider's own limits let
the account spend. A grant with a budget keeps one entry per job that spends,
so at most one per unit of its budget; one with none keeps no entry per job.

--standing JOB=ADDRESS:PORT adds a listener whose every call is counted
against JOB, whatever token it sends, and answered by a keyless upstream
alone: another model is refused as 403 local_only before any upstream
call. The listener names its job, so its address is the credential: the
host's firewall admits JOB's user alone to it. Each listener shares the
ledger and serves at most --max-connections connections of its own.

$ llm-proxy --listen 127.0.0.1:8443 --upstream mistral \
    --upstream local=http://127.0.0.1:8080 \
    -m mistral:mistral-small-latest -m local:qwen3 \
    --budget 2000000 --job-budget 200000 --call-log calls.jsonl
$ MISTRAL_API_KEY=job-1 mistral chat --base-url http://127.0.0.1:8443 "Hi."

--call-log FILE appends the record of each request to FILE, one JSON line
per request, whether it succeeds or fails; rewrite makes one request per
section. The format is the call log's. A log that cannot be
opened stops the command before any request.

The proxy requires --call-log and owns that journal exclusively for its
lifetime. Its journal synchronizes a pending snapshot
before contacting an upstream and a finished snapshot before any refund.
Replay reserves unfinished calls at their ceiling, and the proxy closes each
before it serves, with a finished record that carries no usage: its ceiling
stays charged and its slot is free, since the process that admitted it is
gone. Absent or invalid terminal usage also retains that ceiling. Messages streams settle usage only after
message_stop, with input and terminal output accounting present.

A newline commits each journal record. Appending holds an exclusive lock,
removes an unterminated final tail, and synchronizes the file and a newly
created directory entry. Complete malformed records are errors. A write or
sync failure refuses further model calls. Usage reports retain the latest
snapshot per reservation id, so an admission is not counted as another call.
mistral usage --recorded-only --call-log calls.jsonl reads this evidence in
the open log, not its sealed segments,
without obtaining an API credential or contacting the provider; fireworks usage accepts the same options.

Native Messages requests require unique top-level member names, including
JSON-escaped spellings of the same name. Ambiguous routing or output caps are
refused before admission or forwarding.

The native /v1/messages/count_tokens route uses the same active job/model
authority and Messages relay. It preserves the request and native count
response, requires no max_tokens, and creates no generation debit or call
record. The proxy's body and connection bounds apply to counting too.

A Messages relay is declared with --messages-upstream NAME=URL and its
models with -m NAME:MODEL. The proxy admits POST /v1/messages against
the same job and grant budgets, forwards its body and protocol headers
unchanged to that credential-holding relay, and records the response's
usage. Stream usage is cumulative; each reported field replaces its
previous reading. Input, output, cache-read and cache-write tokens are
disjoint lanes in the call log. GET /api/hello answers locally for
Claude Code. The relay receives only the job's placeholder credential.

A Responses relay is declared with --responses-upstream NAME=URL and its
models with -m NAME:MODEL, as Codex reaches its sign-ins through
codex-x relay. The proxy admits POST /v1/responses against the same
budgets and forwards the body and protocol headers unchanged. Codex names
no max_output_tokens, and its ChatGPT backend refuses one, so such a
request is debited --max-output-tokens in its place and settled from the
completed response's usage, which may exceed it. The usage object counts
cached input within input_tokens; the call log records the uncached
input, the cached input as cache reads, and the output as disjoint lanes.
A model is served on its upstream's path alone.

Call log #

A call log is the evidence a client keeps of each model call, read routinely
to tune how models are used and to catch a call that went wrong without
failing: a tool server that never connected, a model other than the one asked
for, retries that doubled the latency. It is a file of Llm.Call.t records,
one JSON object per line. Every client that keeps one writes this format, so
one report reads the logs of all of them. A record holds no prompt, answer or
tool text: a tool use keeps the MD5 and the size of its input, and a caller
that stores prompts elsewhere names one with prompt_digest.

Member Type Meaning
provider string the provider called, such as anthropic or mistral
client string the program or library that made the call
client_version string, optional its version
model string, optional the model asked for; absent for the client's default
served_model string, optional the model that answered
session_id string, optional the client's conversation id
response_id string, optional the provider's response id
prompt_digest string, optional the digest of a prompt stored elsewhere
state string pending admission or finished terminal snapshot
reservation object, optional checked id, job, grant and positive token ceiling
started_ms integer when the call started, in Unix milliseconds
duration_ms integer how long it took, in milliseconds
first_output_ms integer, optional how long after the start the first text, reasoning or tool call arrived
tools strings the names of the tools the model was offered
servers objects each tool server configured: name, source (optional), status
tool_uses objects each tool call the model made, in order
turns integer the number of model turns
retries integer the number of retried provider requests
stop string, optional the normalized stop reason: end_turn, tool_call, length, content_filter, refusal or another word
provider_stop string, optional the provider's own stop label or result subtype
usage object, optional tokens, in disjoint lanes: input, output, reasoning, cache_read, cache_write
cost_usd number, optional the cost in US dollars, when the provider reports one
error object, optional the failure that ended the call: kind, phase, message, and optionally provider, status, request_id, redacted_body

A server's status is connected, failed, needs_auth, pending,
disabled, missing (configured, and reported by nobody) or another
lowercase word. A tool use has a name and an outcome: ok, error, or
unknown when no result was seen. It may add id, input_md5 with
input_bytes, result_bytes and duration_ms. Optional members are omitted
when absent, the lists are read as empty when absent, and a reader refuses a
member the schema does not name.

This record is of a call whose in-process tool server came up failed, so the
model answered without the server's tool:

let line =
  {|{"state":"finished","provider":"anthropic","client":"claude-code","client_version":"2.1.318","model":"claude-sonnet-4-5","started_ms":1762387200000,"duration_ms":41250,"tools":["Read"],"servers":[{"name":"journal","source":"sdk","status":"failed"}],"tool_uses":[],"turns":1,"retries":0,"provider_stop":"success","usage":{"input":12,"output":850,"reasoning":0,"cache_read":40210,"cache_write":3400},"cost_usd":0.25}|}
# let call = Json.of_string_exn Llm.Call.jsont line ;;
val call : Llm.Call.t = <abstr>
# List.map Llm.Call.Server.name (Llm.Call.unconnected call) ;;
- : string list = ["journal"]

Llm.Call.record sends a request through a client and returns its record
with the result. Llm.Call.recording wraps a client so that each request it
interprets hands its record to a callback. A client driven over another
protocol, such as an agent command-line tool that runs several turns and its
own tools, builds its records with Llm.Call.v.

Accounts #

The pure llm.allowance library owns an account's allowance and its
Llm_allowance.Window values, including the JSON representation shared by
account clients and model proxies.

The llm-eio.accounts library lists the accounts of a vendor's command-line
tool, one per configuration directory (~/.STEM is default,
~/.STEM-NAME is NAME), the allowance windows each has left, and ranks
them by allowance left per hour until reset, behind the shared commands account list, account show,
usage, pick, env and run. Where a vendor mints headless tokens,
token add and token remove keep one per account in the tool's store,
$XDG_CONFIG_HOME/TOOL/tokens/NAME.token, and account list shows each
one's expiry. Accounts with headroom rank by the percentage left in their
longest window per hour until its reset, highest first, then by more left,
then input order. Spent accounts follow, ordered by when headroom returns;
unreadable accounts follow those. --at TIME ranks as at another time. A vendor supplies a Provider.S: codex-x (ocaml-codex) applies it to
Codex CLI and claude-x (ocaml-claude) to Claude Code.

Local proxy load #

llm-proxy usage --url http://127.0.0.1:8443 --json reads the running
proxy's GET /api/usage. Each keyless upstream model has one inference
slot by default (--slots UPSTREAM=COUNT declares another capacity),
reported as an account with one slots window and no reset.
An admitted call occupies the slot until settlement. Token spending does
not occupy a slot after settlement; an unsettled journal admission remains
occupied after restart. Hosted providers are absent from this local load.
The JSON representation is Llm_allowance.named_codec.

Tests #

The codec tests decode the examples of the Fireworks API reference, copied
verbatim. The client is tested against a local fake of the API, the rewrite
against an injected client. The Mistral cases replay streams recorded from its
API by an independent client and error bodies recorded by others, each cited.
Interop traces of the live Mistral API, recorded with curl, are replayed
through the client; two turns of an agent loop replay through Llm.Agent.run
once recorded, and those of Fireworks are not recorded. The agent loop is tested by feeding its machine responses
and results by hand, and its Fsm description is settled; the workspace's
tools run on a temporary directory. Either is recorded
by REGEN=1 dune build @traces with FIREWORKS_API_KEY or MISTRAL_API_KEY
set.

License #

ISC. See LICENSE.md.