-
Notifications
You must be signed in to change notification settings - Fork 8.1k
feat(provider): add FriendliAI provider support #7987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Related PR: anomalyco/models.dev#632 (models.dev - adds variants schema and FriendliAI model data) |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
d23999b to
dba276e
Compare
- Add FriendliAI detection in variants() to return empty object (variants defined via config/models.dev instead of reasoningEffort) - Add providerOptions() handling with parse_reasoning flag for backward compatibility with pre-Dec 2025 models - Add schema() sanitization for Friendli structured output constraints (minLength, maxLength, format, composition keywords per docs)
dba276e to
31e15b2
Compare
| case "@ai-sdk/deepinfra": | ||
| // https://v5.ai-sdk.dev/providers/ai-sdk-providers/deepinfra | ||
| case "@ai-sdk/openai-compatible": | ||
| if (model.providerID === "friendli" || model.api.url?.includes("friendli")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u share a link to this stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sure !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
complete, it’s ok you think?
Summary
Add native support for FriendliAI as an OpenAI-compatible provider with proper handling of Friendli-specific features.
Changes
transform.tsvariants()- Returns empty object for Friendli providerchat_template_kwargsinstead ofreasoningEffortproviderOptions()- Adds Friendli-specific provider optionsthinkingoptionparse_reasoning: truefor backward compatibility with pre-Dec 2025 modelsschema()- Sanitizes JSON Schema for Friendli constraintsminLength,maxLength(string),minimum/maximum(number only)uuid,date-time,date,timeallowed)maxItems, clampsminItems> 1 to 1allOf,oneOf,not(onlyanyOfsupported)additionalPropertiesRelated
Testing
Tested with local build against FriendliAI serverless endpoints:
--variant off/on--variant off/on--variant off/on