Commit Graph
3 Commits
Author SHA1 Message Date
yetone 9588501c02 provider: Ollama's and Ollama Cloud's decision models classify routing groups through System One (Nanka on Discord)
Ollama 0.35.0+ (0.40.5+ for cloud models) serves System One at
POST /v1/systemone, locally and at ollama.com with a key. Its body and
answers are System One's, so magpie's request is sent unchanged (a real
answer adds prompt_eval_cached_count, which is ignored). Its /v1/models
lists the decision models (Tev, Nimble, Clef) among the chat models with
nothing to tell them apart, so clef:27b showed up as a chat model on
Ollama Cloud. /api/tags, asked with the same key, gives each model
capabilities: "decision" (and "vision" for Clef).

- Both presets get Decide = their chat base, and a saved Ollama or
  Ollama Cloud provider is backfilled with its chat base, as oMLX and
  MLX-Serve are.
- ollama_decide.go: the decision list is /api/tags filtered by the
  "decision" capability (ollamaDecides, listedOllamaDecide), kept under
  <id>.decisions. Images come from "vision". The window is the list's
  context_length, else the cloud's 65,536 from Ollama's docs. An Ollama
  older than System One lists no capabilities, so none, and no Jev is
  made up.
- decide.go: oMLX's, MLX-Serve's and Ollama's mixed-provider checks now
  share serverMarksDecisions.
- internal/gui/local_address_test.go: an Ollama added at another address
  moves its decision URL with it, as oMLX's does.
- docs/subsystems/providers-accounts.md says so.

Run, at origin/main ef655acb4 plus this change:
- gofmt -l clean. go vet ./... (darwin), GOOS=linux go vet -tags nogui
  ./..., GOOS=windows go vet ./... all ok.
- set -o pipefail; go test -timeout 45m ./... in a sandbox HOME: every
  package ok except internal/gui, where TestProviderSaveLocalPresetAtItsURLs
  still expected Ollama to have no decision API. I updated it.
  internal/gui alone then failed once, with the failing test's name lost
  to a tail, and passed on the next run (680s), the updated test included.
  That one red isn't identified and isn't filed.
- Broken by hand. Each break turned the new tests red, and each restore
  turned them green:
  - Ollama left out of serverMarksDecisions: tev1 kept as a chat model,
    and a Jev made up.
  - The backfill removed: no Decide on a saved provider.
  - The capability filter removed: smollm counted as a decider.
- Fixtures are real bytes from Ollama 0.40.6 (/api/tags, /v1/models,
  /v1/systemone, the 400 "does not support chat") and from
  ollama.com/api/tags.
- Real use: Ollama 0.40.6 in a sandbox (own HOME, port 11545) with
  tev1:0.8b and smollm:135m. magpie built with -tags nogui under a sandbox
  HOME:
  - provider set ... decide= was backfilled.
  - refresh listed 2 models.
  - provider test ollama: chat ok on smollm, decide 101 ms on tev1:0.8b.
  - group add ... classifier=ollama/tev1:0.8b: the group shows the
    classifier.
- Not tried: Ollama Cloud with a real key (none here, and
  ollama.com/v1/systemone is 401 without one). The GUI suite was not run
  because no GUI asset changed.
2026-10-20 01:25:47 +08:00
yetone 26465bc017 provider, gui: oMLX's decision API moves with its Server address (#1165, #1641)
Since #1641 main fills an oMLX provider's empty Decide with its Chat URL
in Normalize, so a provider saved before #1165 has a localhost Decide.
#1165 moved Chat, Responses and Anthropic to the new Server address but
left Decide behind: System One's decisions kept going to the old
localhost port after the address changed. atAddress now moves Decide too,
in the provider package (local_address.go) and in the editor
(addressFrom/movedURLs in app.js), and the decide-url field follows the
address while the user hasn't typed their own; a Decide the user typed
is kept.

Tests: provider TestProviderAtAddress asserts Decide moves; gui
TestProviderSaveLocalPresetAtItsURLs expects oMLX's Decide moved and the
others empty; local-address.test.cjs checks the saved decide, that the
decide field moves, and that a typed https://jev.example/v1 survives a
second address change.

Run at this commit's tree on origin/main: gofmt; go vet darwin,
GOOS=linux -tags nogui, GOOS=windows; builds for all three;
go test -tags nogui -p 4 ./... green. GUI: local-address 11/11 in
chromium and in webkit; local-address, azure-endpoint, gui-zh-tw,
gui-ja, gui-de and system-one together 43/43.
Broken by hand: without Decide in local_address.go the provider test
goes red; without decide in addressFrom local-address goes 0/11.
Not tried: a real oMLX server.
2026-10-13 13:47:59 +08:00
timonwong 79099d6adb provider, gui, tui: Ollama, LM Studio and oMLX take an address, so a server on another port or computer is the preset's provider (#1165)
The three On this machine presets were pinned to localhost and their
default port: one started on another port, or on another computer on
the LAN, had to be rebuilt as a custom provider or typed URL by URL in
the CLI. They now take an Address (scheme, host and port), and each of
their URLs keeps its own path there (provider.AtAddress, AddressOf; no
scheme means http, only http/https, port 1-65535, a pasted path is
dropped, anything else refused with nothing changed).

- GUI: the add and edit editors have a Server address section under the
  key, folded unless the saved address isn't the preset's, opened and
  focused on a refused one. The Endpoints, Test and Refresh follow what
  is typed; URLs are sent only when the address changed, so ones set
  apart (an import, the CLI) are left alone. zh, zh-TW, ja, de.
- TUI: adding a local preset asks for its address before the key (Enter
  keeps the default), and w edits it.
- CLI: the usage shows provider add ollama url=... anthropic=....
- LM Studio's and oMLX's notes say "port N by default".

timonwong's PR head e63cf18e, merged onto main, which had given oMLX a
decision API (#1641) since: presets.go keeps main's oMLX Decide; app.js
keeps both the Vertex block and the address one; the docs row and -run
list take both.

Run: see the next commit.
2026-10-13 13:47:58 +08:00