Skip to content

feat(providers): add Meta (api.meta.ai) provider + muse-spark-1.1 model#692

Merged
ericleepi314 merged 1 commit into
mainfrom
feat/add-meta-provider
Jul 10, 2026
Merged

feat(providers): add Meta (api.meta.ai) provider + muse-spark-1.1 model#692
ericleepi314 merged 1 commit into
mainfrom
feat/add-meta-provider

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Summary

Adds Meta (api.meta.ai) as an LLM provider and its muse-spark-1.1 reasoning model, via the existing data-driven ProviderSpec registry — the same one-row mechanism used for the other 18 OpenAI-compatible providers.

File Change
providers/openai_compatible_specs.py meta provider spec — base https://api.meta.ai/v1, Bearer auth, env META_API_KEY/META_AI_API_KEY, aliases meta-ai/muse/muse-spark
models/configs.py muse-spark-1.1 — 1,048,576-token context (Meta's documented window), 16K max-output
services/pricing.py pricing tier: input $1.25/M · output $4.25/M · cached-input $0.15/M
tests/test_provider_registry.py cover meta in the exact-set + vendor-defaults assertions
cli.py list meta in the --provider help

Verification

  • Live API: OpenAI-compatible chat + SSE streaming + tool/function calling confirmed; server-side reasoning model (reasoning_tokens); prompt caching (cached_tokens).
  • End-to-end through the agent loop (clawcodex -p ... --provider meta): tool calls round-trip through the OpenAI shim with faithful argument passing; a ~700-word answer completes cleanly (finish_reason=stop, ~2.6K output tokens, no truncation).
  • 223 tests pass across the provider / pricing / model / cost surface.

Notes for reviewers

  • muse-spark-1.1 is a reasoning model; max_output_tokens here drives only the auto-compact reservation — OpenAI-compatible providers don't send a wire max_tokens, so Meta's (generous) server default applies and completes normal answers cleanly.
  • Cache-read pricing is currently inert for all spec (non-DeepSeek) OpenAI-compatible providers: the generic usage builder doesn't map cached_tokenscache_read_input_tokens, so cached input is billed at the full input rate (a safe upper bound). Wiring that mapping is a separate cross-provider change.
  • Pre-existing follow-up (not in this PR): finish_reason="length" isn't detected/recovered for OpenAI-compatible providers (only Anthropic's max_tokens stop reason triggers the 64K escalation). Shared with deepseek-v4-pro / glm-5.2.

🤖 Generated with Claude Code

Register Meta's first-party OpenAI-compatible endpoint and its
muse-spark-1.1 reasoning model via the data-driven ProviderSpec registry
(the same one-row path used for the other 18 OpenAI-compatible providers).

- openai_compatible_specs.py: meta ProviderSpec (base https://api.meta.ai/v1,
  Bearer auth, env META_API_KEY/META_AI_API_KEY, aliases meta-ai/muse/muse-spark)
- models/configs.py: muse-spark-1.1 ModelConfig (1,048,576-token context per
  Meta's docs; 16K max-output drives the auto-compact reservation, not a wire
  cap, since OpenAI-compatible providers rely on the server default)
- services/pricing.py: pricing tier (input $1.25/M, output $4.25/M,
  cached-input $0.15/M)
- tests/test_provider_registry.py: cover meta in the exact-set + vendor-defaults
- cli.py: list meta in the --provider help

Verified against the live API: OpenAI-compatible chat + SSE streaming +
tool/function calling, server-side reasoning (reasoning_tokens), prompt
caching. End-to-end through the agent loop: tool calls round-trip through the
OpenAI shim with faithful argument passing, and long answers complete
(finish_reason=stop, no truncation).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test Results

    1 files      1 suites   7m 55s ⏱️
8 448 tests 8 442 ✅ 6 💤 0 ❌
8 633 runs  8 627 ✅ 6 💤 0 ❌

Results for commit c2e1a9b.

@ericleepi314 ericleepi314 merged commit 0724793 into main Jul 10, 2026
3 checks passed
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