Skip to content

provider: add FriendliAI inference provider - #1756

Open
Lee-Si-Yoon wants to merge 2 commits into
Portkey-AI:mainfrom
Lee-Si-Yoon:provider/friendli
Open

provider: add FriendliAI inference provider#1756
Lee-Si-Yoon wants to merge 2 commits into
Portkey-AI:mainfrom
Lee-Si-Yoon:provider/friendli

Conversation

@Lee-Si-Yoon

@Lee-Si-Yoon Lee-Si-Yoon commented Jul 30, 2026

Copy link
Copy Markdown

Description:

  • Adds FriendliAI as an inference provider. The gateway proxies /v1/chat/completions to Friendli's serverless API at https://api.friendli.ai/serverless/v1.
  • Friendli's API is OpenAI-compatible, but reasoning works differently. When parse_reasoning is on, Friendli splits reasoning into choices[].message.reasoning_content. This change maps that field to content_blocks with type thinking, matching how OpenRouter handles it.
  • Adds Friendli-specific request params: chat_template_kwargs (for enable_thinking on controllable reasoning models like GLM-5.2), parse_reasoning, and include_reasoning.
  • Supports optional X-Friendli-Team header via providerOptions.friendliTeam.
  • Registered friendli in globals.ts, providers/index.ts, test variables, and the README providers table.

A docs page on portkey.ai/docs/integrations/llms would be the next step — happy to help with that if the maintainers want it in this PR or a follow-up.

Tests Run/Test cases added:

  • npm run build passes
  • prettier --check on all modified files
  • eslint on all new and modified files
  • Live API test (requires FRIENDLI_API_KEY env var)

Type of Change:

  • New feature (non-breaking change which adds functionality)

@Lee-Si-Yoon

Copy link
Copy Markdown
Author

Friendly reminder: after merge, could the maintainers add FriendliAI to the providers listing at portkey.ai/models/providers and create the model/docs pages (portkey.ai/models/friendli, portkey.ai/docs/integrations/llms/friendli)? Happy to provide any information needed.

Adds FriendliAI as an OpenAI-compatible inference provider.

- Base URL: https://api.friendli.ai/serverless/v1
- Supports chat completions with streaming
- Maps Friendli's reasoning_content to content_blocks (thinking type),
  following the same pattern as OpenRouter
- Adds Friendli-specific params: chat_template_kwargs, parse_reasoning,
  include_reasoning for controllable reasoning models (e.g. GLM-5.2)
- Optional X-Friendli-Team header via providerOptions.friendliTeam
- Registered in globals, providers index, test variables, and README table
Updates default model and test variables to use GLM-5.2, which supports controllable reasoning via enable_thinking.
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