Skip to content

feat(friendli): fetch model list dynamically from /v1/models#1028

Draft
Lee-Si-Yoon wants to merge 2 commits into
Zoo-Code-Org:mainfrom
Lee-Si-Yoon:feat/friendli-dynamic-models
Draft

feat(friendli): fetch model list dynamically from /v1/models#1028
Lee-Si-Yoon wants to merge 2 commits into
Zoo-Code-Org:mainfrom
Lee-Si-Yoon:feat/friendli-dynamic-models

Conversation

@Lee-Si-Yoon

Copy link
Copy Markdown
Contributor

Stacked on #886. Merge #886 first, then rebase this PR onto main.

Friendli model list is now fetched live from GET /v1/models instead of being hardcoded. The endpoint is public (no auth), same as Vercel AI Gateway and OpenRouter in this repo.

  • New fetcher (fetchers/friendli.ts): zod-validated axios call, maps API fields to ModelInfo (pricing, cache, reasoning effort, image modality, deprecation)
  • FriendliHandler fire-and-forgets a model fetch in constructor; getModel() prefers dynamic data, falls back to static friendliModels
  • "friendli" moved to dynamicProviders; UI uses routerModels.friendli for the model picker
  • 14 fetcher tests, 3 webview tests, 29 existing handler tests pass

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
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bed26f71-7fbc-4dc5-8024-a22ba8437fda

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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