Files
yetone 6bb90df8e9 gateway, gui: an added provider's embedding and rerank models are listed (@rfiacne on X)
@rfiacne asked why an added provider's embedding models aren't
recognised. Routing them already worked: /v1/embeddings and /v1/rerank
took a bare id, provider/id or a slashed id from the provider's fetched
list. But they were nowhere a user looks. GET /v1/models answered
?kind=embedding with 400 and never listed them, and the provider editor
showed only a count, and only when the provider had no chat model.

- /v1/models?kind= takes embedding and rerank (all includes them). Each
  row is provider/model with "kind", owned_by, magpie_label and
  supported_endpoint_types embeddings or jina-rerank, the names Cherry
  Studio's new-api provider reads (listModels.ts ENDPOINT_TYPE_ALIASES).
  Disabled models and those a held key can't reach are left out. The
  default list stays chat models (TestKindGroupsServeEachAPIByRoute).
  Cherry Studio, listed every kind already, gets them too for its
  knowledge bases; ?format=text stays chat. A remote magpie asks by
  headers, not ?kind=, so its list is unchanged.
- gateway.RetrievalModels: the fetched list's Serves models and the
  preset's, each id once, shared by the list and the GUI.
- The provider editor lists Embedding models and Rerank models as read
  only chips (embedIds/rerankIds, retrievalRows), in every language.
  The script budgets rise by 354 for it: the editor draws it, so there
  is no page to move it to.
- docs: integrating.md, the site's integrate page (en, zh), and
  providers-accounts.md; site/node docs-index.mjs rebuilt llms-full.txt
  and search/*.json for them.

Run on mote (load ~20-28 of 18 cores; mica was at 40 of 12), at
6ce8f232c, rebased on origin/main 6635dec7c:
- go test -tags nogui -run 'TestAddedProvidersRetrievalModelsListed|
  TestRetrievalModelsOnce|TestKindGroupsServeEachAPIByRoute|Kind|Cherry|
  Models' ./internal/gateway: ok. TestAddedProvidersRetrievalModelsListed
  is red on the old gateway.go (?kind=embedding,rerank: 400).
- go test -tags nogui -run 'Budget|Provider' ./internal/gui: ok (before
  the rebase; the budget was re-measured after it, at exactly the new
  numbers).
- node --test provider-retrieval-rows and provider-retrieval-only, both
  engines, 5 languages, 900 and 420 px: 46 pass. provider-retrieval-rows
  is red on the old app.js (no rows).
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui ./...:
  ok.
- After the rebase on origin/main 3c9d79d28 and again on 70a881071: the tests above plus
  TestCoreScriptBudget, TestTogetherLiveList and
  TestModelsListMediaOnlyWhenAsked in gateway, gui and provider: ok
  (testenv's docs-index check passes after the rebuild).
- The full go test -tags nogui -timeout 45m ./... was stopped before it
  ended, not run to the end (owner: never hold a verified fix behind a
  full suite).
Not tried: a real provider's live list in the app; the whole GUI suite
(1636 files); OpenRouter, whose embedding models are on a separate
/api/v1/embeddings/models list that magpie doesn't fetch.
2026-11-20 16:12:11 +08:00
..