Skip to content

feat: Meta Model API preset — Muse Spark, day one#69

Merged
yuanhao merged 2 commits into
mainfrom
feat/meta-model-api
Jul 11, 2026
Merged

feat: Meta Model API preset — Muse Spark, day one#69
yuanhao merged 2 commits into
mainfrom
feat/meta-model-api

Conversation

@yuanhao

@yuanhao yuanhao commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

What

Meta opened its first paid API this week (public preview): the Meta Model API serving Muse Spark 1.1, explicitly OpenAI-compatible. This adds day-one support — exactly what the compat-provider + preset architecture is for (~30 lines of substance).

// provider auto-selected; key from META_API_KEY (or Meta's documented MODEL_API_KEY)
let agent = Agent::from_config(ModelConfig::meta("muse-spark-1.1", "Muse Spark 1.1"));
META_API_KEY=... cargo run --example cli -- --provider meta

Details

  • Base https://api.meta.ai/v1 · 1,048,576 context / 131,072 max output · launch pricing ($1.25/$4.25 per M) pre-configured, so session_cost_usd() and the telemetry cost_usd span field work out of the box
  • Conservative compat flags (reasoning_effort/streamed-usage off) until Meta documents them on the chat endpoint; tool calling + json_schema structured outputs ride the standard OpenAI-compat path
  • Key resolution prefers the unambiguous META_API_KEY, accepts Meta's documented (generic) MODEL_API_KEY

Tests (2 new, 392 total green)

Preset pinned to the launch specs (URL, window, pricing, flags) · env resolution incl. preference order.

Verification

clippy -Dwarnings --all-features clean · 392 passed / 0 failed · docs clean.

🤖 Generated with Claude Code

yuanhao and others added 2 commits July 11, 2026 02:22
Meta opened its first paid API this week (public preview): the Meta Model
API serving Muse Spark 1.1, OpenAI-compatible. yoagent supports it via the
compat provider with a one-preset addition.

- ModelConfig::meta(id, name): base https://api.meta.ai/v1, protocol
  OpenAiCompletions, 1,048,576 context / 131,072 max output, launch pricing
  ($1.25/M in, $4.25/M out) pre-configured for session_cost_usd and the
  telemetry cost_usd span field.
- OpenAiCompat::meta(): max_completion_tokens; conservative flags
  (reasoning_effort/streamed-usage off) until Meta documents them on the
  chat endpoint.
- Key resolution: META_API_KEY preferred, Meta's documented MODEL_API_KEY
  accepted (registry table + hint updated).
- CLI example: --provider meta (default model muse-spark-1.1).

Tests: preset values pinned to the launch specs (URL, window, pricing,
conservative flags); env resolution incl. preference order.

Docs: model-presets table row, README provider list, CHANGELOG.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fact-check against Meta's official chat-completions schemas and pricing page
corrected two false assumptions and confirmed the rest:

- reasoning_effort IS documented (none..xhigh, server default medium) —
  supports_reasoning_effort now true, so ThinkingLevel tunes it. Preset docs
  note the gotcha: Off omits the field, which means Meta's medium default
  applies, not "no reasoning". reasoning: true accordingly; README caveat
  updated (openai/deepseek/meta opt in).
- Cached-input pricing added: $0.15/M per the official pricing page (was 0.0
  while the CHANGELOG claimed "launch pricing pre-configured") — cache-heavy
  workloads no longer undercount spend. Test pins it.
- Streamed usage is documented (stream_options.include_usage) — flag and
  comment now say so honestly.
- 128K max output softened to "per Meta's integration examples (no official
  model card yet)"; US-only public preview noted with a date anchor in the
  preset docs + presets table.
- Registry env test hardened (clears a developer-shell META_API_KEY first);
  comment ages better.
- CLI example: qwen-style special case so --provider meta actually reads
  META_API_KEY / MODEL_API_KEY instead of demanding ANTHROPIC_API_KEY.

Verified clean by the fact-checker: base URL, model id casing, 1,048,576
context, $1.25/$4.25 pricing, MODEL_API_KEY attribution wording, and
MaxCompletionTokens (Meta deprecates max_tokens — the code reviewer's
concern resolved in our favor by the official schemas).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yuanhao
yuanhao merged commit 9f3ad10 into main Jul 11, 2026
5 checks passed
@yuanhao
yuanhao deleted the feat/meta-model-api branch July 11, 2026 03:49
@yuanhao yuanhao mentioned this pull request Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant