feat(providers): add Meta (api.meta.ai) provider + muse-spark-1.1 model#692
Merged
Conversation
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>
Test Results 1 files 1 suites 7m 55s ⏱️ Results for commit c2e1a9b. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Meta (
api.meta.ai) as an LLM provider and itsmuse-spark-1.1reasoning model, via the existing data-drivenProviderSpecregistry — the same one-row mechanism used for the other 18 OpenAI-compatible providers.providers/openai_compatible_specs.pymetaprovider spec — basehttps://api.meta.ai/v1, Bearer auth, envMETA_API_KEY/META_AI_API_KEY, aliasesmeta-ai/muse/muse-sparkmodels/configs.pymuse-spark-1.1— 1,048,576-token context (Meta's documented window), 16K max-outputservices/pricing.pytests/test_provider_registry.pymetain the exact-set + vendor-defaults assertionscli.pymetain the--providerhelpVerification
reasoning_tokens); prompt caching (cached_tokens).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).Notes for reviewers
muse-spark-1.1is a reasoning model;max_output_tokenshere drives only the auto-compact reservation — OpenAI-compatible providers don't send a wiremax_tokens, so Meta's (generous) server default applies and completes normal answers cleanly.cached_tokens→cache_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.finish_reason="length"isn't detected/recovered for OpenAI-compatible providers (only Anthropic'smax_tokensstop reason triggers the 64K escalation). Shared withdeepseek-v4-pro/glm-5.2.🤖 Generated with Claude Code