ac4af582301a4e8a29245dbba767eba31334ddf9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6e6aba51c8 |
providers: a key may be for another plan of its vendor, sent to that plan's endpoints
yckonnnn on X uses Volcengine's pay as you go and its Agent Plan, and wants a key of each in one provider. Each plan takes its own keys at its own endpoints (/api/v3, /api/plan/v3, /api/coding/v3), and every key of a provider went to the provider's one plan, so only one kind worked. A key now may say which of its preset's Regions it is for (KeyAccount.Plan; Provider.KeyPlan for the first key, as KeyProtocol). None, or the provider's own plan, is the provider's plan, stored as none: old configs read and write as before. Presets whose plans take keys of their own (PresetDef.KeyPlans): zhipu, zai, stepfun, stepfun-cn, xiaomi, baidu-qianfan, tencent-cloud, huaweicloud, volcengine, siliconflow. Not: yylx (one key everywhere), bailian-decision (decide only), bedrock and bedrock-mantle (regions of one account). Every reader of the region or a base URL, and what it does now: - WithKey (keys.go): moves the key's copy to its plan (atKeyPlan: Chat, Responses, Anthropic, Decide, KeysURL, Website, Catalog via atRegionOf; a provider at a host of its own keeps that host) and marks it keyView. Every gateway key path goes through it: chat, Responses, Messages, count_tokens, failover, embeddings (serveRetrieval via onKeys), drawing (drawOnAccounts via perKeyBarred), key tests (test.go), key_models.go, gui/groups.go, markedKey. - perKeyBarred (gateway/fallback.go): a key whose plan's list lacks the model (PlanServing) is not asked; only when no key's plan has it. - fetch / fetchPerKey / planOnly (models.go): a mixed provider lists each key's plan, a NoList plan from its preset list with no request, pay as you go from /api/v3/models with its own key. - planMedia (PlanEmbeddings, PlanDrawers, PlanVideos): every plan's. - PlanQuotas (planquota.go): each key read at its own plan's source. - volcPlanQuotas, tencentPlanQuotas: one view per plan (planViews). - KeyBalances (balance.go): each key at its plan's host (SiliconFlow). - startVideo / videoMaker (gateway/video.go): a mixed provider starts on a key whose plan makes the model (onKeys) and names it in the id (keyMark), so the poll goes to that key's plan. - GUI: POST /api/keys/plan (SetKeyPlan, then the lists are read again); the editor keeps KeyPlan with an unchanged first key, typed() clears it with a new one; KeepSecrets, AddCopy, backup's withoutKeys carry it. - app.js: planPicker, a plan chip in each key row (the app's own menu, openProtoMenu, through pickPill, which protoPicker now shares), shown for a KeyPlans preset while the provider has several keys or the key has a plan; i18n zh, zh-TW, ja, de. A key's plan is not guessed from the key: Volcengine's keys carry nothing that says their plan. Xiaomi's tp-, Tencent's sk-tp-, MiniMax's sk-cp- and Bailian's sk-sp- are noted in code but not used. Not done: a gateway key held to some keys (videoAsker) on a mixed provider's video may pick another key; a mixed provider whose own plan has no balance source while a key's plan has one is not read; keys left out for their plan don't show in the Routing trace; StepFun's plan windows are a sign-in per site, unchanged. Credit: yckonnnn on X (tweet 2114657701305487483). Run at this commit on origin/main |
||
|
|
8792ee063d |
provider: a Volcengine or Tencent access key is kept through sync, restore, a stale editor and a copy, and a plan card without one says what to give (#1821, Edward4226)
The reporter's Volcengine Agent Plan card vanished: providers.json had
lost accessKeyID/secretAccessKey, and volcPlanQuotas skipped a provider
without them before building any card, so nothing said why.
Writers that dropped the access key, fixed at the cause:
- Sync and restore (Mirror, Restore, davsync take) kept this machine's
access key and balance token only when the incoming provider had no
key at all. A magpie before v0.1.1142 (
|