feat(llm): direct Meta Model API provider for Muse Spark

↗ view on GitHub · Eli Ziff · 2026-08-05 · 8b8c7173

Meta Model API speaks the OpenAI Responses dialect verbatim, so the
adapter is a thin wrapper over the shared streamResponsesApi -- same
shape as openrouter.ts. Probed against muse-spark-1.2 before writing
it: store:false, reasoning.effort, function tools and the standard
response.* SSE event names are all accepted, and the tool loop,
streaming deltas and normalized usage (incl. reasoning + cache-read
tokens) come back correct through Beaver's own dispatch.

Transport rides on the id shape, as it already does for codex: /
claude-p: / ollama: -- bare `muse-spark-*` goes direct, the `meta/`
slug stays on OpenRouter. The existing OpenRouter route is unchanged;
its picker entry is relabelled so the two are distinguishable.

Key resolution takes META_API_KEY first, falling back to MODEL_API_KEY
(the name Meta's docs export).

The -contributor tier is wired but off the default picker: it is ~12x
cheaper because Meta trains on the prompts and completions sent to it,
which is the wrong default for client documents. It is reachable only
once an account enrols; until then it returns an attributed 404 rather
than falling back silently.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GRKSheQsXFWp1ophSt6X11
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents f1b5bc28
Stats 15 files changed , +116 , -8
Part of claude-p transport: alternative LLM backend via the Claude CLI

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-8b8c7173.md from inside the repo you want the change in.

⬇ Download capture-commit-8b8c7173.md