Skip to content

feat(common): register FriendliAI model IDs and provider prefix - #1116

Closed
rekty wants to merge 8801 commits into
CodebuffAI:mainfrom
rekty:feat/friendli-model-ids
Closed

rekty wants to merge 8801 commits into
CodebuffAI:mainfrom
rekty:feat/friendli-model-ids

Conversation

@rekty

@rekty rekty commented Aug 25, 2026

Copy link
Copy Markdown

{
"title": "feat(common): register FriendliAI model IDs and provider prefix",
"head": "rekty:feat/friendli-model-ids",
"base": "main",
"body": "Closes #1089\n\nFriendliAI serves several models already present in the catalog under other providers. Registering their exact HuggingFace-cased IDs under a friendli/ prefix means a maintainer can route them through the private backend (web/src/llm-api/) with no further public changes.\n\n### What this does\n\n- Adds friendli to ALLOWED_MODEL_PREFIXES so the new IDs pass isExplicitlyDefinedModel() and agent-template validation.\n- Introduces a friendliModels map with two serverless models (GLM-5.2, MiniMax-M2.5) and spreads it into the canonical models object.\n- Adds friendli.ai to providerDomains and a friendli/ prefix check in getLogoForModel so the favicon resolver picks up the right domain.\n\n### What a maintainer port would need to do next\n\nAll inference routing lives behind the private web/src/llm-api/ boundary. The pieces a matching routing file would need:\n\n| Detail | Value |\n|---|---|\n| Endpoint | https://api.friendli.ai/serverless/v1/chat/completions |\n| Auth | Bearer <token> + optional X-Friendli-Team |\n| Metadata | GET .../serverless/v1/models |\n| Reasoning | boolean parse_reasoning / include_reasoning, chat_template_kwargs.enable_thinking; response field reasoning_content (not thinking block) |\n| Incompatibility | response_format + tools together returns 422 |\n| IDs | Case-sensitive exact HuggingFace casing |\n\nTests:\n- bun test common/src/__tests__/model-config.test.ts — 7 pass\n- bun test common/src/__tests__/freebuff-peak-hours.test.ts — 24 pass"
}

Source: CodebuffAI/freebuff-private@e76be31e6b3ffe894ec6fb6fe0289ecce9fd4457
Source: CodebuffAI/freebuff-private@06c76ce5a6e375830b676c2473d7a15c27e4c9f1
Source: CodebuffAI/freebuff-private@228c49cc80b37907fa8506aa8e1fb4d817179493
Source: CodebuffAI/freebuff-private@38d88e049957238b9aba84f7dd25f973fdee5087
Source: CodebuffAI/freebuff-private@3b89b37ffac9f705298099c1a92cc12ff86439b1
Source: CodebuffAI/freebuff-private@6a6c2560a0d89ff9d4fb3b3b3dcf459e718aa015
Source: CodebuffAI/freebuff-private@6bbe32b95effc6c81479ffe1be3854bbf2b6a175
Source: CodebuffAI/freebuff-private@9c49375348733a5bdc7b13b5e5c71b6aac3c150c
Source: CodebuffAI/freebuff-private@18d9e898bfc0e44ac24017f980f81033123c2f83
Source: CodebuffAI/freebuff-private@67af829808816a20e117fd57c654b471e6857eae
Source: CodebuffAI/freebuff-private@3285b31b770fd5b07e854d993ac8e87e5e679f8b
Source: CodebuffAI/freebuff-private@79bfc42ece2b9e4cc4a88140e23479e5809da816
Source: CodebuffAI/freebuff-private@65df59b85e220b8f962fe01cdbe7d4e18824e320
Source: CodebuffAI/freebuff-private@e6b914d9b664add769727e29d0984c69e8717e74
Source: CodebuffAI/freebuff-private@1781f579a7d28f6609f75540529b58bd5ee8208f
Source: CodebuffAI/freebuff-private@d266b9ad26aa4d539a01097c6be544afada6b7e6
Source: CodebuffAI/freebuff-private@a518571bda930dd9f6d3c513f405f879d9474585
Source: CodebuffAI/freebuff-private@ff3322e5cc03fc4f33796f8f49fce51744b6ecb0
Source: CodebuffAI/freebuff-private@b96808549f5ba06fbac82369b419fef88bc6c6ae
Source: CodebuffAI/freebuff-private@2cf94fb38519b4fdc2caa80ce073ec2e423b2ddd
Source: CodebuffAI/freebuff-private@a3a71b3b96bd25ce2f4258704267af6ff646f9ec
Source: CodebuffAI/freebuff-private@0693087e2e254602d44514d9c44099410dda8323
Source: CodebuffAI/freebuff-private@efdf10960936cf0f87f8141191fb76b55706ed85
Source: CodebuffAI/freebuff-private@ad6bc9adfa02f0b967424df70a6b1202bcec285d
Source: CodebuffAI/freebuff-private@c71eca2672511e34e48c6e36344b060af95f0ee6
Source: CodebuffAI/freebuff-private@edac5d5b4121e342607f803b277b2a20eed859a0
Source: CodebuffAI/freebuff-private@05417f841e0359ece3e80876fe19ba5f25044f51
Source: CodebuffAI/freebuff-private@7f756a3d3d5ae9237b007a038334de6f143daff1
Source: CodebuffAI/freebuff-private@665569ba8321ae5a453633dd0693029e3414bf93
Source: CodebuffAI/freebuff-private@050b9f6fd4658f2589d2b4498e99298e49ccbb81
github-actions Bot and others added 24 commits August 24, 2026 20:18
Source: CodebuffAI/freebuff-private@2610acaadc5b7bcf8eded2d362c33b422ac1c69c
Source: CodebuffAI/freebuff-private@a186b4d3778cc5fac6907d345479f1bae22ae999
Source: CodebuffAI/freebuff-private@5faa5f6218239ee702b36f72bdf1c420c44d8389
Source: CodebuffAI/freebuff-private@fbd4ee3918974c2ced6550233174c3cbc19eaecc
Source: CodebuffAI/freebuff-private@7a5444e862dfd2b9d5b590c057719a662a7df4c7
Source: CodebuffAI/freebuff-private@241f8bfa8a8a97867900b2f71754638efa2cbe86
Source: CodebuffAI/freebuff-private@cfc7760af31f29f1acc7153a7e9fcb48d35f730b
Source: CodebuffAI/freebuff-private@6965ea40dbf54a44c932ca4df63b0dd6377bfec5
Source: CodebuffAI/freebuff-private@ecf4fa2e98fcefcec1a96cbd596b5b16bccd97e3
Source: CodebuffAI/freebuff-private@ce96ca2455d9c6a027d6e41048e8f2520f78754f
Source: CodebuffAI/freebuff-private@890653e2610c57c22298d532cae0129efb26f862
Source: CodebuffAI/freebuff-private@d60d93125f90cdca18e1fc97819b91997081a97f
Source: CodebuffAI/freebuff-private@70ba2a57ab1e48c9f799107675dfb6029dc6d54f
Source: CodebuffAI/freebuff-private@9c2be6595fa98153b9ec0474caed5ec3a58ec116
Source: CodebuffAI/freebuff-private@c1db5271ba86e1c89c3c9fc0c6e6a2a857d3b5dd
Source: CodebuffAI/freebuff-private@2846f67777f75ee23da1e3a3047176d66953d906
Source: CodebuffAI/freebuff-private@f5329a11c8431d6f5c98581c2bfc67fb2d1829ba
Source: CodebuffAI/freebuff-private@e319a9e3de31d8c4cd1d0a9285dfd5360eebb7a1
Source: CodebuffAI/freebuff-private@9cbbba39efda2071b8325bf2779b39170e35348c
Source: CodebuffAI/freebuff-private@8470da01520ea7c273efb6eca943fd37fb265189
Source: CodebuffAI/freebuff-private@884e8a41dd02bb5c0be09d8da8e465c994a6c6a4
Source: CodebuffAI/freebuff-private@b550c712e828f5211de07c5699a643fe0fa8f22e
Source: CodebuffAI/freebuff-private@ddfa6c89a27176e4e1afef0bd597077698e3d9e3
Closes CodebuffAI#1089

FriendliAI serves several models already in the catalog under other
providers (GLM-5.2, MiniMax-M2.5). Register their HuggingFace-cased IDs
under the friendli/ prefix so a private-backend routing layer can pick
them up without any public code changes beyond this catalog entry.

Changes:
- Add 'friendli' to ALLOWED_MODEL_PREFIXES
- Add friendliModels map with two serverless models
- Spread friendliModels into the canonical models set
- Add friendli.ai to providerDomains and getLogoForModel
@codebuff-team

Copy link
Copy Markdown
Contributor

The mechanics here follow the existing pattern (minimax, mimo, tencent prefixes) reasonably well — prefix allowlist, a models map, providerDomains, and the getLogoForModel branch are all touched consistently, and the diff is small and easy to read.

The problem is the payload. GLM-5.2 and MiniMax-M2.5 are not model versions that exist publicly as of this writing — the real lineages are GLM-4.x from Zhipu/Z.ai and MiniMax-M1/M2 from MiniMax. Registering IDs that don't correspond to anything FriendliAI actually serves means this addition is either speculative or incorrect, and either way it's not something a maintainer can port as-is — they'd have to first verify the IDs against FriendliAI's /serverless/v1/models endpoint themselves, which defeats the purpose of the PR doing that legwork.

Separately: without the private web/src/llm-api/ routing wired up, these entries do nothing except pass validation and resolve a favicon — that's fine as a preparatory PR in principle, but only if the underlying model IDs are real. The PR body's routing table (auth headers, reasoning field names, the response_format+tools 422 conflict) is oddly specific for models that don't appear to exist, which raises the question of whether this was generated rather than verified against FriendliAI's actual docs.

Before this is portable: confirm the exact model IDs FriendliAI currently serves (via their models endpoint or docs) and swap in real, currently-available IDs. Also worth spreading friendliModels in a diffable location relative to the map ordering used by other providers if there's a documented convention (unclear from this diff alone).

@codebuff-team codebuff-team added bot:triaged Classified by the community triage bot pr:needs-work Right idea, not mergeable as written labels Aug 25, 2026
@victorxheng

Copy link
Copy Markdown

Apologies — this PR was auto-closed by GitHub when we force-pushed a history rewrite of this repository (repository maintenance; every commit SHA changed). That was not a judgment on this PR, and GitHub does not allow us to reopen it because the commits it was based on no longer exist in the new history.

If you'd like to continue with this change: rebase your branch onto the new main (or recreate it from a fresh clone) and open a new PR — feel free to link back to this one for context, and we'll pick up the review there.

Sorry for the churn, and thanks for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:triaged Classified by the community triage bot pr:needs-work Right idea, not mergeable as written

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add FriendliAI as a model provider

3 participants