Uh oh!
There was an error while loading. Please reload this page.
feat(friendli): fetch model list dynamically from /v1/models - #1027
feat(friendli): fetch model list dynamically from /v1/models#1027Lee-Si-Yoon wants to merge 2 commits into
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Convert Friendli from a static provider (4 hardcoded models) to a dynamic provider that fetches the live model list from the public https://api.friendli.ai/serverless/v1/models endpoint at runtime. - Add getFriendliModels() fetcher with zod schema validation - Wire friendli into modelCache, webviewMessageHandler, and dynamicProviders - FriendliHandler loads dynamic models in constructor, falls back to static friendliModels for cold-start and API lag - UI model picker uses routerModels.friendli instead of static list - Add fetcher spec (14 tests) and update Friendli.spec.tsx with ModelPicker mock
889b49e to
bab25e8CompareCodecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Builds on #886. Merge #886 first, then this PR rebases cleanly.
Friendli's model list is now fetched live from
GET /v1/modelsinstead of being hardcoded to four entries. The endpoint is public (no auth header needed), same as Vercel AI Gateway and OpenRouter in this repo.fetchers/friendli.ts): zod-validated axios call mapping API fields toModelInfo— pricing, cache read/write, reasoning effort options, image modality, deprecation.FriendliHandlerfire-and-forgets a model fetch in the constructor.getModel()prefers dynamic data, falls back to staticfriendliModelsduring cold start or API lag."friendli"moved todynamicProviders.ModelPickerfed byrouterModels.friendli, replacing the hardcoded dropdown.