Skip to content

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

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

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

Conversation

@Lee-Si-Yoon

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

Copy link
Copy Markdown
Contributor

Builds on #886. Merge #886 first, then this PR rebases cleanly.

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

  • New fetcher (fetchers/friendli.ts): zod-validated axios call mapping API fields to ModelInfo — pricing, cache read/write, reasoning effort options, image modality, deprecation.
  • FriendliHandler fire-and-forgets a model fetch in the constructor. getModel() prefers dynamic data, falls back to static friendliModels during cold start or API lag.
  • "friendli" moved to dynamicProviders.
  • UI settings panel renders a ModelPicker fed by routerModels.friendli, replacing the hardcoded dropdown.
  • 14 fetcher tests, 3 webview tests, 29 existing handler tests all pass.

@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: ff9f5958-419c-458e-8e87-49c121e0ef2b

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.

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
@Lee-Si-Yoon
Lee-Si-Yoon force-pushed the feat/friendli-dynamic-models branch from 889b49e to bab25e8 Compare July 26, 2026 12:14
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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