mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-24 21:41:08 +02:00
Merge pull request #738 from rowboatlabs/feat/settings-models-picker
feat: connect-only model settings with dynamic composer model picker
This commit is contained in:
commit
1e8e36ebfb
6 changed files with 763 additions and 193 deletions
|
|
@ -259,8 +259,20 @@ export async function listModelsForProvider(
|
|||
url = `https://generativelanguage.googleapis.com/v1beta/models?key=${apiKey ?? ""}`;
|
||||
break;
|
||||
case "openrouter":
|
||||
url = "https://openrouter.ai/api/v1/models";
|
||||
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
||||
// /api/v1/models is a public catalog — it returns the full
|
||||
// list even with an invalid/absent key, so listing it can't
|
||||
// tell a bad key from a good one (a false "Connected"). When
|
||||
// a key is given, hit the account-scoped /models/user behind
|
||||
// Bearer auth instead: a bad key 401s here and the shared
|
||||
// throw below surfaces it. Same OpenAI-shaped { data:[{id}] }
|
||||
// response, so the parse path is unchanged. No key → keep the
|
||||
// public catalog so an unconfigured provider can still preview.
|
||||
if (apiKey) {
|
||||
url = "https://openrouter.ai/api/v1/models/user";
|
||||
headers["Authorization"] = `Bearer ${apiKey}`;
|
||||
} else {
|
||||
url = "https://openrouter.ai/api/v1/models";
|
||||
}
|
||||
break;
|
||||
case "ollama":
|
||||
url = `${(baseURL ?? "http://localhost:11434").replace(/\/$/, "")}/api/tags`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue