feat(ai-chat): add direct Meta API provider integration - #3544
Open
dileep812 wants to merge 1 commit into
Open
Conversation
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.
Fixes #3519
Description
Adds direct Meta API integration to Puter's AI Chat Driver, enabling native execution of Meta models (
meta:muse-spark-1.2,meta:muse-spark-1.1, andmeta:muse-code-1.0) alongside existing providers.Changes
models.ts: DefinedMETA_MODELSwith context limits (1,048,576 tokens), max output caps (8,192 tokens), cost keys (prompt_tokens,completion_tokens), and alias mappings.MetaProvider.ts: ImplementedIChatProviderinterface using OpenAI SDK compatibility pointing to Meta's API endpoint (https://api.meta.ai/v1). Configured accurate token usage cost calculations inusage_calculator.ChatCompletionDriver.ts: WiredMetaProviderintoChatCompletionDriverprovider map whenproviders['meta']key is configured.config.template.jsonc: Added"meta"configuration block under"ai".MetaProvider.test.ts: Added unit test suite covering initialization, catalog methods, model listing, completion output, and cost override calculation assertions.How Has This Been Tested?
Ran backend Vitest suite: