routing: Cheapest first prices Ollama Cloud's DeepSeek models at double from 12:00 to 18:00 UTC on weekdays (hayden4608)

hayden4608 on Discord asked that time-of-day routing use the gap
between peak and off-peak prices, citing https://ollama.com/pricing.
That page (read live on 11-01) gives Off-Peak rows for two models
only, deepseek-v4.1-flash ($0.30/$1.20 peak, $0.15/$0.60 off-peak) and
deepseek-v4-pro ($1.32/$3.96 peak, $0.66/$1.98), and says off-peak is
"outside 12:00 and 18:00 UTC on weekdays and all day on weekends".
models.dev's ollama-cloud catalog lists the off-peak prices, so magpie
priced Ollama Cloud's peak hours at half.

- catalog: a new Peak kind, PeakOllama. Its hours are 12:00 to 18:00
  UTC, Monday to Friday, with no holidays. PeakFactor (2) matches the
  page for both models, cache reads included.
- provider: a peakBill for ollama.com (preset/catalog ollama-cloud)
  that names the two models. Dated tags (deepseek-v4-pro:1017) count
  as their model; the bare name before ':' is compared without
  allocating. Every other model there (glm-5.3, gpt-oss...) and every
  other vendor stays flat. A local Ollama, a relay that names itself
  ollama-cloud, and an ollama.com.evil host are not matched.
- GUI: a model's price tooltip names Ollama's hours for peak "ollama".
  The Cheapest first and rate-window texts no longer say that only
  DeepSeek's hours count, in en, zh, zh-TW, ja and de.
- docs/reference.md, site docs (en, zh, ja) and the gateway-routing
  and providers-accounts subsystem pages say the same.

Run (on mote through mote-run, at this tree rebased on ef3e74a07):
- go test for ./internal/catalog ./internal/provider ./internal/gateway
  for the new and changed tests, under TZ=UTC, Pacific/Kiritimati,
  Pacific/Pago_Pago and Asia/Kathmandu: ok. The tests check 11:59,
  12:00, 17:59, 18:00, 00:00 and 23:59 on weekdays, a Chinese holiday
  Monday, Saturday and Sunday, at +14, -11 and +0545 instants.
- gofmt -l internal: empty. go vet ./..., GOOS=linux go vet -tags
  nogui ./... and GOOS=windows go vet ./...: ok.
- GUI (Chromium and WebKit): model-price-edit, provider-rate-windows,
  routing-cheapest-first, i18n-keys, gui-de, gui-ja, gui-zh-tw.
- go test -count=1 -timeout 45m ./... (one suite on mote): every
  package ok except internal/gui. TestCoreScriptBudget was 7 bytes
  over, so this commit drops a comment from the app.js change rather
  than raise the budget; it passes now. TestMainWindowCorners/
  macOS_26_SDK (the window's toolbar taken off) is red on mote and
  touches nothing here: it is red
  the same way at origin/main ef3e74a07 alone, and is #3949 (macOS 27).

Broken by hand (each red, then restored):
- the peak hours ending at 17:00: TestOllamaPeakHours red.
- the Ollama bill removed: TestPeakOf, TestOllamaCloudOffPeakPrice red.
- tagged false: the dated-tag rows red.
- Ollama's hours used for every Peak kind: TestPeakHours,
  TestPriceOfPeak and TestCheapestFirstGroupFollowsPeakHours red.

Not tried: a real Ollama Cloud account or bill; a local Ollama's
":cloud" models (sent through the local server, so not priced here);
other vendors' off-peak schedules; the site is not deployed.
This commit is contained in:
yetone
2026-11-01 19:02:59 +08:00
parent 7d1f2ecba3
commit 9d08993c8b
18 changed files with 329 additions and 27 deletions
+3 -1
View File
@@ -1779,7 +1779,9 @@ each of these groups ordered by the share used.
for it, else its list price, at the provider's price rate and rate
windows; a model its vendor serves free costs nothing. DeepSeek's own
API, and Command Code's and OpenCode Go's DeepSeek models, bill double
in their peak hours (weekdays 01:00–04:00 and 06:00–10:00 UTC), so a
in their peak hours (weekdays 01:00–04:00 and 06:00–10:00 UTC), and
Ollama Cloud's DeepSeek V4.1 Flash and V4 Pro in its own (weekdays
12:00–18:00 UTC; half price the rest of the time), so a
DeepSeek model on two providers goes to whichever is cheaper at that
hour. A tie on that goes to the cheaper cache read; members that still
cost the same keep their order, and one with no known price goes after
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -18,7 +18,7 @@ keys and accounts per request is in [Gateway routing and fallback](gateway-routi
| Part | Responsibility | Source |
| --- | --- | --- |
| Provider | `Provider` holds the endpoint bases for each `Protocol` (Chat, Responses, Anthropic, Gemini), the keys, `Fallback`, `Routing`, `Sink`, `Affinity`, concurrency and queue limits, `Headers`, `Proxy`, models, and balance settings. `BaseAPI` is the API a custom provider's editor shows its Base URL as: the one the user picked and saved, while it has a URL, so a provider with a chat URL beside its Responses one isn't shown as OpenAI compatible after Responses was picked. Requests go by which URLs are set; `Native`, the API agents' model files ask a model on, takes `BaseAPI` where it serves the model, after the OpenAI-model and Claude-on-Messages rules (nb5p on Discord: dsh asked a Responses relay's GPTs on Chat). A custom provider's `Gemini` URL is the base of Google's Gemini API, or of one that answers as it does (#1346): `GeminiBase` keeps it as the base (…/v1beta added to a bare host, a pasted endpoint or model list cut back), requests go to `models/{model}:streamGenerateContent?alt=sse` under it (`GeminiPath`) signed with `x-goog-api-key` (`AuthHeaders`), and its models are listed by `catalog.FetchGemini` (paged, only those serving generateContent). Factory's sign-in alone keeps its own `/generate` route and token (`FactoryGemini`). `Account` is set only for a subscription and is never saved (`json:"-"`). | [`provider.go`](../../internal/provider/provider.go) |
| Rate windows | A provider bills the hours it says at its own rate (#2463): `RateWindows`, each a span `HH:MM`–`HH:MM` on this computer's clock whose end may pass its start over midnight, the days it is on (`Days`, `time.Weekday`'s numbers, none for every day), and a rate from just over 0 to 1000 at three decimals. The first window that holds a call's time multiplies the price again, on top of `PriceRate` — a price the user set for a model included, which the price rate alone leaves as set — and outside every window the price rate alone counts. A call is priced at its own time wherever a cost is counted call by call — the Usage page and its CSV, a gateway key's cost limit, the gateway's sessions in Usage — by `EffectivePriceAt`, which `EffectivePriceIn` is at `time.Now()`, and its record's time is read on this computer's clock whatever zone it was written in (a call reported as `…Z`); the Sessions page sums a session's calls by model, not by time, so it prices them without any window (`BasePriceIn` in `sessions.priceOf`), the same at every hour it is read; the ledger's `Pricer` holds each provider's base price and windows once and reads each record's rate at the record's own time, so a window that opens mid-page prices only the calls inside it; a gateway block's rows (`blockPricer`, the Requests tab) take their price from a memo asked with no time, which `RateAt` reads as no window, and each row is put at its own window's rate there (`atWindow` before `Price.In`). A list price billed double at peak (`Peak`, DeepSeek's and the relays `PeakOf` names) is part of the base: the final price is that base, peak included, times the window's rate, so a provider with a `Peak` needs no window for the same hours: the order is the spec (the author, YangHonghang), so a 0.8 window on a shared DeepSeek key takes 0.8 off the peak price at peak, and a window set over the official peak hours would double them twice, which the editor's hint says under the windows. `/v1/models` prices its list at now (`EntryPricer`); the model list magpie writes into an agent's own config (`AgentPricer`, Pi's and omp's cost) leaves every window out, since nothing rewrites that file as a window opens or closes. `CheckRateWindows` says what is wrong with a set; the editor keeps the windows under Advanced, drawn by `ratewindows.js`, which app.js imports when an editor draws the field (`rateWindowsField`) so it adds nothing to the core's scripts — until it has loaded, a save leaves `rateWindows` out, which keeps them. A provider with windows shows what it bills at now on its row (`rateNow` in `/api/providers`, `rateNowOf` in the GUI's `providers.go`: `RateAt` on the server's clock, which calls are counted on, never the browser's); one with a price rate alone shows nothing new. Windows are kept with the provider: a save that leaves them out keeps them, null or an empty list clears them, and a signed-in account's survive its `Save` — the account branch and `withPicks` both go through one list, `accountSettings`, beside its `PriceRate`, or the editor's Save would quietly drop what it shows (#4738: two lists drifted, and `additionalTools`, extraBody, reply headers, its rests, `limitRestOff` and patience were each lost one way; `TestAccountSettingsKept`). | [`ratewindow.go`](../../internal/provider/ratewindow.go), [`models.go`](../../internal/provider/models.go), [`ledger.go`](../../internal/usage/ledger.go) (`Pricer`), [`app.js`](../../internal/gui/assets/app.js) (`rateWindowsField`), [`ratewindows.js`](../../internal/gui/assets/ratewindows.js), [`gui/providers.go`](../../internal/gui/providers.go) (`rateNowOf`) |
| Rate windows | A provider bills the hours it says at its own rate (#2463): `RateWindows`, each a span `HH:MM`–`HH:MM` on this computer's clock whose end may pass its start over midnight, the days it is on (`Days`, `time.Weekday`'s numbers, none for every day), and a rate from just over 0 to 1000 at three decimals. The first window that holds a call's time multiplies the price again, on top of `PriceRate` — a price the user set for a model included, which the price rate alone leaves as set — and outside every window the price rate alone counts. A call is priced at its own time wherever a cost is counted call by call — the Usage page and its CSV, a gateway key's cost limit, the gateway's sessions in Usage — by `EffectivePriceAt`, which `EffectivePriceIn` is at `time.Now()`, and its record's time is read on this computer's clock whatever zone it was written in (a call reported as `…Z`); the Sessions page sums a session's calls by model, not by time, so it prices them without any window (`BasePriceIn` in `sessions.priceOf`), the same at every hour it is read; the ledger's `Pricer` holds each provider's base price and windows once and reads each record's rate at the record's own time, so a window that opens mid-page prices only the calls inside it; a gateway block's rows (`blockPricer`, the Requests tab) take their price from a memo asked with no time, which `RateAt` reads as no window, and each row is put at its own window's rate there (`atWindow` before `Price.In`). A list price billed double at peak (`Peak`, DeepSeek's, Ollama Cloud's two DeepSeek models' and the relays `PeakOf` names) is part of the base: the final price is that base, peak included, times the window's rate, so a provider with a `Peak` needs no window for the same hours: the order is the spec (the author, YangHonghang), so a 0.8 window on a shared DeepSeek key takes 0.8 off the peak price at peak, and a window set over the official peak hours would double them twice, which the editor's hint says under the windows. `/v1/models` prices its list at now (`EntryPricer`); the model list magpie writes into an agent's own config (`AgentPricer`, Pi's and omp's cost) leaves every window out, since nothing rewrites that file as a window opens or closes. `CheckRateWindows` says what is wrong with a set; the editor keeps the windows under Advanced, drawn by `ratewindows.js`, which app.js imports when an editor draws the field (`rateWindowsField`) so it adds nothing to the core's scripts — until it has loaded, a save leaves `rateWindows` out, which keeps them. A provider with windows shows what it bills at now on its row (`rateNow` in `/api/providers`, `rateNowOf` in the GUI's `providers.go`: `RateAt` on the server's clock, which calls are counted on, never the browser's); one with a price rate alone shows nothing new. Windows are kept with the provider: a save that leaves them out keeps them, null or an empty list clears them, and a signed-in account's survive its `Save` — the account branch and `withPicks` both go through one list, `accountSettings`, beside its `PriceRate`, or the editor's Save would quietly drop what it shows (#4738: two lists drifted, and `additionalTools`, extraBody, reply headers, its rests, `limitRestOff` and patience were each lost one way; `TestAccountSettingsKept`). | [`ratewindow.go`](../../internal/provider/ratewindow.go), [`models.go`](../../internal/provider/models.go), [`ledger.go`](../../internal/usage/ledger.go) (`Pricer`), [`app.js`](../../internal/gui/assets/app.js) (`rateWindowsField`), [`ratewindows.js`](../../internal/gui/assets/ratewindows.js), [`gui/providers.go`](../../internal/gui/providers.go) (`rateNowOf`) |
| Anthropic key header | A provider of the user's own on a third-party Anthropic API is sent its key as both `x-api-key` and `Authorization: Bearer` (`AuthHeaders`); Anthropic's own API, Bedrock, Azure, Vertex and every subscription account have their own and never this choice (`BothAuth` is false). Some services refuse the two together with a 401 (Aloha on Discord: "鉴权 header, x-api-key 和 Authorization 不可以同时存在"), so `Provider.AuthHeader` (`authHeader`: empty for both, `x-api-key` or `bearer`; anything else is read as empty) sends one alone, picked in the editor's Key header row (shown while `bothAuth` is true, or a custom provider's Anthropic URL is a third party's). Left at both, a 401 whose body `catalog.BothAuthRefused` tells as that refusal (it names both headers and says they can't be together, in Chinese or English) is asked once more with x-api-key alone, then Bearer alone (`RetryOneAuth`, in the gateway's `forwardOnce` and the provider test's `probe`; `catalog.fetchOne` for the model list through `listAuth`); the first not answered 401 or 403 is kept with `LearnAuthHeader`, which never changes a pick the user made. A request carrying the user's own `Authorization` or `x-api-key` header is never retried. | [`authheader.go`](../../internal/provider/authheader.go), [`test.go`](../../internal/provider/test.go), [`catalog/authheader.go`](../../internal/catalog/authheader.go), [`catalog/live.go`](../../internal/catalog/live.go) |
| GLM Coding Plan key at pay as you go | Zhipu's and Z.ai's presets offer Pay as you go first (`/api/paas/v4`) and the Coding Plan (`/api/coding/paas/v4`, Responses at `/api/v1`); both share `/api/anthropic`, which bills the plan, so a plan's key left at Pay as you go worked in Claude Code and was refused 429 code 1113 "余额不足或无可用资源包" in Codex (@cleverpigo on X). Nothing in the key tells the two apart, so a Chat request to `open.bigmodel.cn` or `api.z.ai` at `/api/paas/v4` refused 1113 is asked once more at `/api/coding/paas/v4` (`RetryZhipuCoding`, in the gateway's `forwardOnce` and the provider test's `probe`). Served there, `LearnZhipuCoding` moves a saved provider with that one key, still at that URL, to the plan's OpenAI URL (and the preset's plan Responses URL when it has none); one with other keys stays and is asked again each time. Refused there too, the 1113 body keeps its code and gets both URLs and what to change in its message (`ZhipuNoBalanceHint`). A pay-as-you-go key with a balance is never answered 1113 and never sent to the plan's endpoint. | [`zhipu_coding.go`](../../internal/provider/zhipu_coding.go), [`test.go`](../../internal/provider/test.go) |
| Zhipu's 200 refusals | Zhipu's and Z.ai's `/api/v1` (the GLM Coding Plan's Responses API, from their Codex pages) and `/api/monitor` answer a refusal 200 in the platform's envelope, `{"code":1000,"msg":"身份验证失败。","success":false}`, where their OpenAI and Anthropic endpoints answer the same key 401 (@xanahopper on X: a refused key tested green on the Responses row only). `ZhipuEnveloped` turns a 2xx JSON body from `open.bigmodel.cn` or `api.z.ai` with `success: false` into `{"error":{"code","message"}}` at the status Zhipu's error-code table gives (1000–1005 → 401, 1113 and 1302–1399 → 429, 1220 → 403, 1210–1229, 1261 and 1301 → 400, anything else → 502), in the provider test's `probe` (endpoint tests, model tests, Detect APIs) and the gateway's `forwardOnce`. A stream, a compressed body, a body over 64 KB and every other host pass as they came. The plan's quota card for a key refused there (1000–1005, or a 401) says `<Zhipu or Z.ai> didn't take this key (<their words>): …` with the vendor's API-keys page (`zhipuRefused`), not asked again as a team's key, and the GUI shows it as that (`quotaError`) rather than "Allowance unavailable". | [`zhipu_envelope.go`](../../internal/provider/zhipu_envelope.go), [`planquota.go`](../../internal/provider/planquota.go), [`test.go`](../../internal/provider/test.go) |
+13 -2
View File
@@ -21,10 +21,17 @@ const (
// and OpenCode Go (https://opencode.ai/docs/go) bill DeepSeek's models
// at, neither of which names a holiday
PeakWeekdays Peak = "weekdays"
// PeakOllama is Ollama Cloud's: 12:00 to 18:00 UTC, Monday to Friday
// (https://ollama.com/pricing: off-peak outside 12:00 and 18:00 UTC on
// weekdays, and all of Saturday and Sunday), where its
// off-peak rows are half its peak ones and models.dev lists the
// off-peak row as the price. It names no holiday.
PeakOllama Peak = "ollama"
)
// PeakFactor is what a call in the peak hours costs, times the off-peak
// list price: DeepSeek's off-peak rates are half its peak rates.
// list price: DeepSeek's off-peak rates are half its peak rates, and so
// are Ollama Cloud's.
const PeakFactor = 2
// At is whether a call made at t is in the peak hours. A zero time, a
@@ -37,7 +44,11 @@ func (k Peak) At(t time.Time) bool {
if wd := u.Weekday(); wd == time.Saturday || wd == time.Sunday {
return false
}
if h := u.Hour(); !(h >= 1 && h < 4 || h >= 6 && h < 10) {
h := u.Hour()
if k == PeakOllama {
return h >= 12 && h < 18
}
if !(h >= 1 && h < 4 || h >= 6 && h < 10) {
return false
}
// the peak hours are 09:00 to 18:00 in China, so a holiday's date is
+44
View File
@@ -64,6 +64,50 @@ func TestPeakHours(t *testing.T) {
}
}
// Ollama Cloud's peak hours are 12:00 to 18:00 UTC, Monday to Friday,
// holidays too: each edge a minute either side, on a weekday, a weekend
// day and a Chinese holiday, in whatever zone the time is written in.
func TestOllamaPeakHours(t *testing.T) {
far := []*time.Location{time.UTC, time.FixedZone("+14", 14*3600), time.FixedZone("-11", -11*3600), time.FixedZone("+0545", 5*3600+45*60)}
edges := map[string]bool{
"11:59": false, "12:00": true, "17:59": true, "18:00": false,
"00:00": false, "02:00": false, "23:59": false, "15:30": true,
}
for _, c := range []struct {
day string
weekday bool
}{
{"2026-10-28", true}, // a Wednesday
{"2026-10-26", true}, // a Monday
{"2026-10-30", true}, // a Friday
{"2026-10-05", true}, // a Monday in China's National Day break
{"2026-10-31", false}, // a Saturday
{"2026-11-01", false}, // a Sunday
} {
for hm, peak := range edges {
v, err := time.Parse("2006-01-02 15:04", c.day+" "+hm)
if err != nil {
t.Fatal(err)
}
for _, z := range far {
if got := PeakOllama.At(v.In(z)); got != (peak && c.weekday) {
t.Errorf("ollama %s %s UTC in %s: peak %v", c.day, hm, z, got)
}
}
}
}
if PeakOllama.At(time.Time{}) {
t.Error("a call with no time is at peak")
}
pro := Price{Input: 0.66, Output: 1.98, CacheRead: 0.022, Peak: PeakOllama}
if got, want := pro.In(time.Date(2026, 10, 28, 12, 0, 0, 0, time.UTC)), (Price{Input: 1.32, Output: 3.96, CacheRead: 0.044}); !got.Same(want) {
t.Errorf("peak: %+v, want %+v", got, want)
}
if got, want := pro.In(time.Date(2026, 10, 28, 11, 59, 0, 0, time.UTC)), (Price{Input: 0.66, Output: 1.98, CacheRead: 0.022}); !got.Same(want) {
t.Errorf("off-peak: %+v, want %+v", got, want)
}
}
// A price with no Peak holds at every hour; a peak-billed one doubles in
// its peak hours, every part of it, tiers too, and the price In gives is
// one that holds (In again doesn't double it twice).
+94
View File
@@ -121,3 +121,97 @@ func TestCheapestFirstIsAGroupsOnly(t *testing.T) {
t.Fatalf("the group didn't keep Cheapest first: %+v", gs)
}
}
// Ollama Cloud bills deepseek-v4.1-flash at half outside 12:00 to 18:00
// UTC on weekdays and all of Saturday and Sunday (hayden4608 on Discord,
// https://ollama.com/pricing): $0.15/$0.60 then, $0.30/$1.20 in its peak
// hours. A relay at one $0.22/$0.88 goes behind Ollama Cloud off-peak and
// ahead of it at peak, at each edge a minute either side and on a
// Saturday, on the clock of a far zone too, and the relay's price is the
// same at every hour.
func TestCheapestFirstGroupFollowsOllamaOffPeak(t *testing.T) {
fresh(t)
up := httptest.NewServer(http.HandlerFunc(streamed))
t.Cleanup(up.Close)
to, _ := url.Parse(up.URL)
for _, p := range []provider.Provider{
{ID: "ollama-cloud", Preset: "ollama-cloud", Name: "Ollama Cloud", Key: "sk-oc", Chat: "https://ollama.com/v1", Models: []string{"deepseek-v4.1-flash"}},
{ID: "rl", Name: "Relay", Key: "sk-rl", Chat: "https://relay.example/v1", Models: []string{"deepseek-v4.1-flash"}},
} {
if err := provider.Save(p); err != nil {
t.Fatal(err)
}
}
f := func(v float64) *float64 { return &v }
if err := settings.Save(settings.Settings{ModelPrices: map[string]settings.ModelPrice{
"ollama-cloud/deepseek-v4.1-flash": {Input: f(0.15), Output: f(0.60), CacheRead: f(0.003), CacheWrite: f(0)},
"rl/deepseek-v4.1-flash": {Input: f(0.22), Output: f(0.88), CacheRead: f(0.01), CacheWrite: f(0)},
}}); err != nil {
t.Fatal(err)
}
if err := provider.SaveGroup(provider.Group{
Name: "O", Members: []string{"rl/deepseek-v4.1-flash", "ollama-cloud/deepseek-v4.1-flash"}, Routing: provider.Cheapest,
}); err != nil {
t.Fatal(err)
}
s := New()
s.client = &http.Client{Transport: roundTripFunc(func(r *http.Request) (*http.Response, error) {
r.URL.Scheme, r.URL.Host = to.Scheme, to.Host
return http.DefaultTransport.RoundTrip(r)
})}
ask := func(at time.Time) *Route {
t.Helper()
old := priceClock
priceClock = func() time.Time { return at }
defer func() { priceClock = old }()
code, body := postAs(t, s, "", `{"model":"group/o","stream":true,"messages":[{"role":"user","content":"x"}]}`)
if code != 200 {
t.Fatalf("code %d: %s", code, body)
}
return s.trace.routes[len(s.trace.routes)-1]
}
for _, c := range []struct {
at time.Time
peak bool
}{
{time.Date(2026, 10, 28, 11, 59, 0, 0, time.UTC), false}, // a Wednesday
{time.Date(2026, 10, 28, 12, 0, 0, 0, time.UTC), true},
{time.Date(2026, 10, 28, 17, 59, 0, 0, time.UTC), true},
{time.Date(2026, 10, 28, 18, 0, 0, 0, time.UTC), false},
{time.Date(2026, 10, 31, 14, 0, 0, 0, time.UTC), false}, // a Saturday
// 12:00 UTC on the Wednesday written in UTC+14 (Thursday 02:00
// there), and 17:59 UTC in UTC-11 (Wednesday 06:59)
{time.Date(2026, 10, 29, 2, 0, 0, 0, time.FixedZone("+14", 14*3600)), true},
{time.Date(2026, 10, 28, 6, 59, 0, 0, time.FixedZone("-11", -11*3600)), true},
// Saturday 13:00 UTC, which is Sunday 03:00 in UTC+14
{time.Date(2026, 11, 1, 3, 0, 0, 0, time.FixedZone("+14", 14*3600)), false},
} {
r := ask(c.at)
want := "ollama-cloud"
if c.peak {
want = "rl"
}
if r.Order[0].Provider != want {
t.Fatalf("%v (%v UTC): Cheapest first went to %q first, want %q: %+v", c.at, c.at.UTC(), r.Order[0].Provider, want, r.Order)
}
for _, w := range r.Order {
if w.Price == nil {
t.Fatalf("%v: %s has no price: %+v", c.at, w.Provider, w)
}
switch w.Provider {
case "ollama-cloud":
in, out := 0.15, 0.60
if c.peak {
in, out = 0.30, 1.20
}
if w.Price.Input != in || w.Price.Output != out || w.Price.Peak != c.peak {
t.Fatalf("%v: Ollama Cloud's row %+v, want %v/%v peak %v", c.at, w.Price, in, out, c.peak)
}
case "rl":
if w.Price.Input != 0.22 || w.Price.Output != 0.88 || w.Price.Peak {
t.Fatalf("%v: the relay's row %+v, want its one price", c.at, w.Price)
}
}
}
}
}
+2 -1
View File
@@ -11436,7 +11436,8 @@ function renderModels(p) {
priceBox.title = m.remoteList
? t("What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: what the other magpie counts it at, shown greyed. A price set here isn't multiplied by the provider's price rate", { id: m.id })
: t("What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: its list price, shown greyed. A price set here isn't multiplied by the provider's price rate", { id: m.id });
if (m.list?.peak) priceBox.title += "\n" + t("Off-peak price, the list's or one set here: the Usage page doubles it from 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday{x}", { x: m.list.peak == "deepseek" ? t(", except on Chinese public holidays") : "" });
if (m.list?.peak == "ollama") priceBox.title += "\n" + t("Off-peak price, the list's or one set here: the Usage page doubles it from 12:00 to 18:00 UTC, Monday to Friday");
else if (m.list?.peak) priceBox.title += "\n" + t("Off-peak price, the list's or one set here: the Usage page doubles it from 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday{x}", { x: m.list.peak == "deepseek" ? t(", except on Chinese public holidays") : "" });
priceBox.append(el("span", "", t("Price, $ / 1M tokens")));
const typed = draft.priceTyped?.[id];
const cell = (value, placeholder, k, label) => {
+16 -12
View File
@@ -1781,8 +1781,8 @@ const I18N = {
"Speed first: {who} hasn't answered {model} lately, so it takes this request to be measured \u2014 one request in five goes to one not measured.": "速度优先:{who} 最近没回答过 {model},所以这个请求给它,好测一下速度——每五个请求有一个给没测过的。",
"Speed first: none has answered {model} lately, so {who}, first in the list, goes first and its answer measures it.": "速度优先:最近都没回答过 {model},所以按列出的顺序先用 {who},它的回答会测出速度。",
"Cheapest first": "最便宜优先",
"Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — DeepSeek's peak hours count double — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last.": "请求先发给此刻模型最便宜的成员:看此时每百万输入、输出 token 的价格——DeepSeek 的高峰时段按双倍算——价格相同时看缓存读取哪个便宜;价格相同的按列出的顺序,不知道价格的排最后。",
"Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so DeepSeek's own API, at double price in its peak hours, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.": "最便宜优先:此刻模型最便宜的成员先用,看此时每百万输入、输出 token 的价格——所以 DeepSeek 官方 API 在高峰时段双倍价格时,排在当时收费更低的服务商后面,低谷时段则排在它前面。价格相同的按列出的顺序;不知道价格的排最后。",
"Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — a vendor's peak hours count double where it bills them so, as DeepSeek and Ollama Cloud do — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last.": "请求先发给此刻模型最便宜的成员:看此时每百万输入、输出 token 的价格——按高峰时段双倍计价的服务商(如 DeepSeek、Ollama Cloud),高峰时段按双倍算——价格相同时看缓存读取哪个便宜;价格相同的按列出的顺序,不知道价格的排最后。",
"Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so a model billed double in its vendor's peak hours, as DeepSeek's own API and Ollama Cloud's DeepSeek models are, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.": "最便宜优先:此刻模型最便宜的成员先用,看此时每百万输入、输出 token 的价格——所以在服务商高峰时段双倍计价的模型(如 DeepSeek 官方 API、Ollama Cloud 的 DeepSeek 模型),高峰时段排在当时收费更低的服务商后面,低谷时段则排在它前面。价格相同的按列出的顺序;不知道价格的排最后。",
"{in} in, {out} out a million tokens": "每百万 token 输入 {in}、输出 {out}",
"it costs least now, even at its peak price — {price}.": "即使按高峰价格,它此刻也最便宜——{price}。",
"Cheapest first: {model} costs least on {who} now, even at its peak price — {price}.": "最便宜优先:即使按高峰价格,{model} 此刻在 {who} 上也最便宜——{price}。",
@@ -2513,6 +2513,7 @@ const I18N = {
"Its own name, every reasoning level it has, whether it sees images, the API it is asked on, the model it is the same as, its own id, and its list price": "恢复默认名称、全部推理档位、是否支持图片、请求所用的协议、它等同的模型、它自己的 ID,以及官方价格",
"What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: its list price, shown greyed. A price set here isn't multiplied by the provider's price rate": "{id} 的价格,单位为美元 / 百万 tokens,用量页按它计费;留空即官方价格(灰字所示)。这里设的价格不再乘以供应商的价格倍率",
"Off-peak price, the list's or one set here: the Usage page doubles it from 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday{x}": "闲时价(官方价格或在此设置的价格):周一至周五 UTC 01:00–04:00 与 06:00–10:00{x},用量页按两倍计",
"Off-peak price, the list's or one set here: the Usage page doubles it from 12:00 to 18:00 UTC, Monday to Friday": "闲时价(官方价格或在此设置的价格):周一至周五 UTC 12:00–18:00,用量页按两倍计",
", except on Chinese public holidays": "(中国法定节假日除外)",
"What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: what the other magpie counts it at, shown greyed. A price set here isn't multiplied by the provider's price rate": "{id} 的价格,单位为美元 / 百万 tokens,用量页按它计费;留空即另一台 magpie 计费用的价格(灰字所示)。这里设的价格不再乘以供应商的价格倍率",
"Price, $ / 1M tokens": "价格($ / 百万 tokens)",
@@ -4331,7 +4332,7 @@ const I18N = {
"Rate windows": "时段倍率",
"Add a window": "添加时段",
"Inside a window a call costs the official price times its rate, on top of the price rate; outside every window the price rate alone counts. The first window that holds a call wins. Times are on the clock of the computer magpie runs on, and 22:00–6:00 crosses midnight. No day ticked is every day. A price you set for a model is scaled by the window too. Changing the windows prices the calls already counted again, as a changed price rate does.": "时段内的调用按官方价乘以该时段的倍率计费,叠加在价格倍率之上;时段之外只按价格倍率。调用命中第一个满足的时段。时间按运行 magpie 的那台电脑的时钟,22:00–6:00 表示跨零点。不勾任何星期表示每天。为模型单独设的价格同样按该倍率缩放。修改时段后,已记录的调用也按新时段重算,与修改价格倍率相同。",
"DeepSeek's own API, Command Code and OpenCode Go already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.": "DeepSeek 官方 API、Command Code 和 OpenCode Go 的 DeepSeek 模型已按官方高峰时段双倍计价:不要再把这些时段设为时段倍率,否则会重复计算。",
"DeepSeek's own API, Command Code, OpenCode Go and Ollama Cloud already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.": "DeepSeek 官方 API、Command Code、OpenCode Go 和 Ollama Cloud 的 DeepSeek 模型已按各自的高峰时段双倍计价:不要再把这些时段设为时段倍率,否则会重复计算。",
"Window starts at": "时段开始于",
"Window ends at": "时段结束于",
"Rate in this window": "该时段的倍率",
@@ -6124,8 +6125,8 @@ const I18N = {
"Speed first: {who} hasn't answered {model} lately, so it takes this request to be measured \u2014 one request in five goes to one not measured.": "速度優先:{who} 最近沒回答過 {model},所以這個請求給它,好測一下速度——每五個請求有一個給沒測過的。",
"Speed first: none has answered {model} lately, so {who}, first in the list, goes first and its answer measures it.": "速度優先:最近都沒回答過 {model},所以按列出的順序先用 {who},它的回答會測出速度。",
"Cheapest first": "最便宜優先",
"Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — DeepSeek's peak hours count double — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last.": "請求先發給此刻模型最便宜的成員:看此時每百萬輸入、輸出 token 的價格——DeepSeek 的尖峰時段按雙倍算——價格相同時看快取讀取哪個便宜;價格相同的按列出的順序,不知道價格的排最後。",
"Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so DeepSeek's own API, at double price in its peak hours, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.": "最便宜優先:此刻模型最便宜的成員先用,看此時每百萬輸入、輸出 token 的價格——所以 DeepSeek 官方 API 在尖峰時段雙倍價格時,排在當時收費更低的服務商後面,離峰時段則排在它前面。價格相同的按列出的順序;不知道價格的排最後。",
"Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — a vendor's peak hours count double where it bills them so, as DeepSeek and Ollama Cloud do — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last.": "請求先發給此刻模型最便宜的成員:看此時每百萬輸入、輸出 token 的價格——按尖峰時段雙倍計價的服務商(如 DeepSeek、Ollama Cloud),尖峰時段按雙倍算——價格相同時看快取讀取哪個便宜;價格相同的按列出的順序,不知道價格的排最後。",
"Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so a model billed double in its vendor's peak hours, as DeepSeek's own API and Ollama Cloud's DeepSeek models are, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.": "最便宜優先:此刻模型最便宜的成員先用,看此時每百萬輸入、輸出 token 的價格——所以在服務商尖峰時段雙倍計價的模型(如 DeepSeek 官方 API、Ollama Cloud 的 DeepSeek 模型),尖峰時段排在當時收費更低的服務商後面,離峰時段則排在它前面。價格相同的按列出的順序;不知道價格的排最後。",
"{in} in, {out} out a million tokens": "每百萬 token 輸入 {in}、輸出 {out}",
"it costs least now, even at its peak price — {price}.": "即使按尖峰價格,它此刻也最便宜——{price}。",
"Cheapest first: {model} costs least on {who} now, even at its peak price — {price}.": "最便宜優先:即使按尖峰價格,{model} 此刻在 {who} 上也最便宜——{price}。",
@@ -6834,6 +6835,7 @@ const I18N = {
"Its own name, every reasoning level it has, whether it sees images, the API it is asked on, the model it is the same as, its own id, and its list price": "恢復預設名稱、全部推理檔位、是否支援圖片、請求所用的協議、它等同的模型、它自己的 ID,以及官方價格",
"What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: its list price, shown greyed. A price set here isn't multiplied by the provider's price rate": "{id} 的價格,單位為美元 / 百萬 tokens,用量頁按它計費;留空即官方價格(灰字所示)。這裡設的價格不再乘以供應商的價格倍率",
"Off-peak price, the list's or one set here: the Usage page doubles it from 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday{x}": "離峰價(官方價格或在此設定的價格):週一至週五 UTC 01:00–04:00 與 06:00–10:00{x},用量頁按兩倍計",
"Off-peak price, the list's or one set here: the Usage page doubles it from 12:00 to 18:00 UTC, Monday to Friday": "離峰價(官方價格或在此設定的價格):週一至週五 UTC 12:00–18:00,用量頁按兩倍計",
", except on Chinese public holidays": "(中國法定節假日除外)",
"What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: what the other magpie counts it at, shown greyed. A price set here isn't multiplied by the provider's price rate": "{id} 的價格,單位為美元 / 百萬 tokens,用量頁按它計費;留空即另一台 magpie 計費用的價格(灰字所示)。這裡設的價格不再乘以供應商的價格倍率",
"Price, $ / 1M tokens": "價格($ / 百萬 tokens)",
@@ -8669,7 +8671,7 @@ const I18N = {
"Rate windows": "時段倍率",
"Add a window": "新增時段",
"Inside a window a call costs the official price times its rate, on top of the price rate; outside every window the price rate alone counts. The first window that holds a call wins. Times are on the clock of the computer magpie runs on, and 22:00–6:00 crosses midnight. No day ticked is every day. A price you set for a model is scaled by the window too. Changing the windows prices the calls already counted again, as a changed price rate does.": "時段內的呼叫以官方價乘上該時段的倍率計費,疊加在價格倍率之上;時段之外只按價格倍率。呼叫命中第一個符合的時段。時間按執行 magpie 的那台電腦的時鐘,22:00–6:00 表示跨午夜。不勾任何星期表示每天。為模型單獨設的價格同樣按該倍率縮放。修改時段後,已記錄的呼叫也依新時段重新計算,與修改價格倍率相同。",
"DeepSeek's own API, Command Code and OpenCode Go already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.": "DeepSeek 官方 API、Command Code 和 OpenCode Go 的 DeepSeek 模型已按官方尖峰時段雙倍計價:不要再把這些時段設為時段倍率,否則會重複計算。",
"DeepSeek's own API, Command Code, OpenCode Go and Ollama Cloud already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.": "DeepSeek 官方 API、Command Code、OpenCode Go 和 Ollama Cloud 的 DeepSeek 模型已按各自的尖峰時段雙倍計價:不要再把這些時段設為時段倍率,否則會重複計算。",
"Window starts at": "時段開始於",
"Window ends at": "時段結束於",
"Rate in this window": "該時段的倍率",
@@ -10443,8 +10445,8 @@ const I18N = {
"Speed first: {who} hasn't answered {model} lately, so it takes this request to be measured \u2014 one request in five goes to one not measured.": "速度優先:{who} は最近 {model} に応答していないため、測るためにこのリクエストを受けます。5 件に 1 件は測っていないものに回ります。",
"Speed first: none has answered {model} lately, so {who}, first in the list, goes first and its answer measures it.": "速度優先:最近 {model} に応答したものがないため、並び順で最初の {who} が先に使われ、その応答で速さを測ります。",
"Cheapest first": "最安優先",
"Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — DeepSeek's peak hours count double — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last.": "リクエストは、いまモデルが最も安いメンバーへ先に送られます。この時間帯の入力・出力 100 万トークンあたりの価格で比べ(DeepSeek のピーク時間帯は 2 倍)、同じ価格ならキャッシュ読み取りの安い方が先です。同じ価格のものは設定順で、価格が分からないものは最後です。",
"Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so DeepSeek's own API, at double price in its peak hours, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.": "最安優先:いまモデルが最も安いメンバーが先です。この時間帯の入力・出力 100 万トークンあたりの価格で比べるので、ピーク時間帯に 2 倍になる DeepSeek 公式 API は、その時間はより安いプロバイダーの後ろに、オフピークにはその前に来ます。同じ価格のものは設定順、価格が分からないものは最後です。",
"Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — a vendor's peak hours count double where it bills them so, as DeepSeek and Ollama Cloud do — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last.": "リクエストは、いまモデルが最も安いメンバーへ先に送られます。この時間帯の入力・出力 100 万トークンあたりの価格で比べ(DeepSeek や Ollama Cloud のようにピーク時間帯を 2 倍で請求するベンダーは、その時間帯は 2 倍)、同じ価格ならキャッシュ読み取りの安い方が先です。同じ価格のものは設定順で、価格が分からないものは最後です。",
"Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so a model billed double in its vendor's peak hours, as DeepSeek's own API and Ollama Cloud's DeepSeek models are, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.": "最安優先:いまモデルが最も安いメンバーが先です。この時間帯の入力・出力 100 万トークンあたりの価格で比べるので、DeepSeek 公式 API や Ollama Cloud の DeepSeek モデルのようにベンダーのピーク時間帯に 2 倍になるモデルは、その時間はより安いプロバイダーの後ろに、オフピークにはその前に来ます。同じ価格のものは設定順、価格が分からないものは最後です。",
"{in} in, {out} out a million tokens": "100 万トークンあたり入力 {in}、出力 {out}",
"it costs least now, even at its peak price — {price}.": "ピーク価格でも、いま最も安いためです({price})。",
"Cheapest first: {model} costs least on {who} now, even at its peak price — {price}.": "最安優先:ピーク価格でも、{model} はいま {who} で最も安いです({price})。",
@@ -11173,6 +11175,7 @@ const I18N = {
"Its own name, every reasoning level it has, whether it sees images, the API it is asked on, the model it is the same as, its own id, and its list price": "元の名前、すべての推論レベル、画像対応の有無、リクエストに使う API、同じモデルの指定、元の ID、公式価格",
"What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: its list price, shown greyed. A price set here isn't multiplied by the provider's price rate": "{id} の価格(米ドル / 100 万トークン)。使用量ページはこれで計算します。空欄なら公式価格(灰色で表示)。ここで設定した価格にはプロバイダーの価格倍率は掛かりません",
"Off-peak price, the list's or one set here: the Usage page doubles it from 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday{x}": "公式価格もここで設定した価格もオフピーク料金です。月曜から金曜の UTC 01:00–04:00 と 06:00–10:00{x}は、使用量ページで 2 倍として計算します",
"Off-peak price, the list's or one set here: the Usage page doubles it from 12:00 to 18:00 UTC, Monday to Friday": "公式価格もここで設定した価格もオフピーク料金です。月曜から金曜の UTC 12:00–18:00 は、使用量ページで 2 倍として計算します",
", except on Chinese public holidays": "(中国の法定休日を除く)",
"What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: what the other magpie counts it at, shown greyed. A price set here isn't multiplied by the provider's price rate": "{id} の価格(米ドル / 100 万トークン)。使用量ページはこれで計算します。空欄なら相手の magpie が計算に使う価格(灰色で表示)。ここで設定した価格にはプロバイダーの価格倍率は掛かりません",
"Price, $ / 1M tokens": "価格($ / 100 万トークン)",
@@ -13009,7 +13012,7 @@ const I18N = {
"Rate windows": "時間帯倍率",
"Add a window": "時間帯を追加",
"Inside a window a call costs the official price times its rate, on top of the price rate; outside every window the price rate alone counts. The first window that holds a call wins. Times are on the clock of the computer magpie runs on, and 22:00–6:00 crosses midnight. No day ticked is every day. A price you set for a model is scaled by the window too. Changing the windows prices the calls already counted again, as a changed price rate does.": "時間帯内の呼び出しは公式価格にその時間帯の倍率を掛けた額で計上され、価格倍率にさらに重ねられます。時間帯の外では価格倍率のみが適用されます。呼び出しは最初に一致した時間帯の倍率です。時刻は magpie が動いているコンピュータの時計で、22:00–6:00 は深夜0時をまたぎます。曜日を1つも選ばない場合は毎日です。モデルに個別に設定した価格も同様にその倍率が掛かります。時間帯を変更すると、記録済みの呼び出しも新しい時間帯で計算し直されます(価格倍率の変更と同じです)。",
"DeepSeek's own API, Command Code and OpenCode Go already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.": "DeepSeek 公式 API、Command Code、OpenCode Go の DeepSeek モデルは公式のピーク時間帯をすでに 2 倍で計上しています。その時間帯を時間帯倍率として追加しないでください。二重に計上されます。",
"DeepSeek's own API, Command Code, OpenCode Go and Ollama Cloud already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.": "DeepSeek 公式 API、Command Code、OpenCode Go、Ollama Cloud の DeepSeek モデルは、それぞれのピーク時間帯をすでに 2 倍で計上しています。その時間帯を時間帯倍率として追加しないでください。二重に計上されます。",
"Window starts at": "時間帯の開始時刻",
"Window ends at": "時間帯の終了時刻",
"Rate in this window": "この時間帯の倍率",
@@ -14793,8 +14796,8 @@ const I18N = {
"Speed first: {who} hasn't answered {model} lately, so it takes this request to be measured \u2014 one request in five goes to one not measured.": "Schnellste zuerst: {who} hat {model} zuletzt nicht beantwortet und bekommt diese Anfrage, um gemessen zu werden — eine von fünf Anfragen geht an einen nicht Gemessenen.",
"Speed first: none has answered {model} lately, so {who}, first in the list, goes first and its answer measures it.": "Schnellste zuerst: Keiner hat {model} zuletzt beantwortet, daher geht {who}, der Erste in der Liste, zuerst, und seine Antwort misst ihn.",
"Cheapest first": "Günstigste zuerst",
"Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — DeepSeek's peak hours count double — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last.": "Anfragen gehen an das Mitglied, dessen Modell jetzt am wenigsten kostet, nach seinem Preis je Million Tokens Eingabe und Ausgabe zu dieser Stunde — DeepSeeks Spitzenzeiten zählen doppelt — und bei gleichem Preis nach dem günstigeren Cache-Lesen; gleich teure behalten ihre Reihenfolge, eines ohne bekannten Preis kommt zuletzt.",
"Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so DeepSeek's own API, at double price in its peak hours, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.": "Günstigste zuerst: Das Mitglied, dessen Modell jetzt am wenigsten kostet, kommt zuerst, nach seinem Preis je Million Tokens Eingabe und Ausgabe zu dieser Stunde — so steht DeepSeeks eigene API, in ihren Spitzenzeiten zum doppelten Preis, dann hinter einem Anbieter, der weniger verlangt, und außerhalb davor. Gleich teure behalten ihre Reihenfolge; eines ohne bekannten Preis kommt zuletzt.",
"Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — a vendor's peak hours count double where it bills them so, as DeepSeek and Ollama Cloud do — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last.": "Anfragen gehen an das Mitglied, dessen Modell jetzt am wenigsten kostet, nach seinem Preis je Million Tokens Eingabe und Ausgabe zu dieser Stunde — Spitzenzeiten zählen doppelt, wo ein Anbieter sie so abrechnet, wie DeepSeek und Ollama Cloud — und bei gleichem Preis nach dem günstigeren Cache-Lesen; gleich teure behalten ihre Reihenfolge, eines ohne bekannten Preis kommt zuletzt.",
"Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so a model billed double in its vendor's peak hours, as DeepSeek's own API and Ollama Cloud's DeepSeek models are, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.": "Günstigste zuerst: Das Mitglied, dessen Modell jetzt am wenigsten kostet, kommt zuerst, nach seinem Preis je Million Tokens Eingabe und Ausgabe zu dieser Stunde — so steht ein Modell, das in den Spitzenzeiten seines Anbieters doppelt kostet, wie DeepSeeks eigene API und die DeepSeek-Modelle von Ollama Cloud, dann hinter einem Anbieter, der weniger verlangt, und außerhalb davor. Gleich teure behalten ihre Reihenfolge; eines ohne bekannten Preis kommt zuletzt.",
"{in} in, {out} out a million tokens": "{in} Eingabe, {out} Ausgabe je Million Tokens",
"it costs least now, even at its peak price — {price}.": "es kostet jetzt am wenigsten, sogar zum Spitzenpreis — {price}.",
"Cheapest first: {model} costs least on {who} now, even at its peak price — {price}.": "Günstigste zuerst: {model} kostet jetzt bei {who} am wenigsten, sogar zum Spitzenpreis — {price}.",
@@ -15523,6 +15526,7 @@ const I18N = {
"Its own name, every reasoning level it has, whether it sees images, the API it is asked on, the model it is the same as, its own id, and its list price": "Eigener Name, alle Reasoning-Stufen, Bildunterstützung, die angefragte API, das Modell, dem es entspricht, die eigene ID und der Listenpreis",
"What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: its list price, shown greyed. A price set here isn't multiplied by the provider's price rate": "Was {id} kostet, in US-Dollar pro Million Tokens, wie die Nutzungsseite rechnet; leer: der Listenpreis (grau). Ein hier gesetzter Preis wird nicht mit dem Preisfaktor des Anbieters multipliziert",
"Off-peak price, the list's or one set here: the Usage page doubles it from 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday{x}": "Listenpreis oder hier gesetzter Preis gilt außerhalb der Spitzenzeit: Montag bis Freitag von 01:00 bis 04:00 und 06:00 bis 10:00 UTC{x} zählt ihn die Nutzungsseite doppelt",
"Off-peak price, the list's or one set here: the Usage page doubles it from 12:00 to 18:00 UTC, Monday to Friday": "Listenpreis oder hier gesetzter Preis gilt außerhalb der Spitzenzeit: Montag bis Freitag von 12:00 bis 18:00 UTC zählt ihn die Nutzungsseite doppelt",
", except on Chinese public holidays": ", außer an chinesischen Feiertagen,",
"What {id} costs, in US dollars per million tokens, as the Usage page counts it; empty: what the other magpie counts it at, shown greyed. A price set here isn't multiplied by the provider's price rate": "Was {id} kostet, in US-Dollar pro Million Tokens, wie die Nutzungsseite rechnet; leer: der Preis, mit dem das andere magpie rechnet (grau). Ein hier gesetzter Preis wird nicht mit dem Preisfaktor des Anbieters multipliziert",
"Price, $ / 1M tokens": "Preis, $ / 1 Mio. Tokens",
@@ -17349,7 +17353,7 @@ const I18N = {
"Rate windows": "Zeitfenster",
"Add a window": "Zeitfenster hinzufügen",
"Inside a window a call costs the official price times its rate, on top of the price rate; outside every window the price rate alone counts. The first window that holds a call wins. Times are on the clock of the computer magpie runs on, and 22:00–6:00 crosses midnight. No day ticked is every day. A price you set for a model is scaled by the window too. Changing the windows prices the calls already counted again, as a changed price rate does.": "Innerhalb eines Zeitfensters kostet ein Aufruf den offiziellen Preis mal dessen Rate, zusätzlich zum Preisfaktor; außerhalb aller Zeitfenster zählt nur der Preisfaktor. Das erste Zeitfenster, das den Aufruf hält, gewinnt. Zeiten gelten nach der Uhr des Computers, auf dem magpie läuft; 22:00–6:00 geht über Mitternacht. Kein Wochentag angehakt heißt jeder Tag. Ein selbst gesetzter Modellpreis wird ebenfalls mit der Rate skaliert. Werden die Zeitfenster geändert, werden auch bereits gezählte Aufrufe neu berechnet, wie bei einem geänderten Preisfaktor.",
"DeepSeek's own API, Command Code and OpenCode Go already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.": "DeepSeeks eigene API, Command Code und OpenCode Go rechnen ihre DeepSeek-Modelle in den Spitzenzeiten schon doppelt: diese Stunden nicht noch einmal als Zeitfenster eintragen, sonst zählen sie zweifach.",
"DeepSeek's own API, Command Code, OpenCode Go and Ollama Cloud already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.": "DeepSeeks eigene API, Command Code, OpenCode Go und Ollama Cloud rechnen ihre DeepSeek-Modelle in den Spitzenzeiten schon doppelt: diese Stunden nicht noch einmal als Zeitfenster eintragen, sonst zählen sie zweifach.",
"Window starts at": "Zeitfenster beginnt um",
"Window ends at": "Zeitfenster endet um",
"Rate in this window": "Rate in diesem Zeitfenster",
@@ -540,7 +540,7 @@ function routingPage(part) {
// say them (app.js ROUTINGS), so every language is already spoken
weight: ["By weight", "Requests spread over the keys or accounts by the weight set beside each: one weighing 3 takes three requests for every one weighing 1 takes, evenly over a few requests. One that fails is passed over while it rests, and the others share its requests; a conversation stays with it as Stays says."],
free: ["Free first", "Requests go to what costs nothing first: the models their vendor serves at no cost to this subscription's allowance or credits, in their listed order, and only when those can't answer to one that spends them. Nothing that cost nothing is left unused."],
cheap: ["Cheapest first", "Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — DeepSeek's peak hours count double — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last."],
cheap: ["Cheapest first", "Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — a vendor's peak hours count double where it bills them so, as DeepSeek and Ollama Cloud do — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last."],
fast: ["Speed first", "Requests go to the one that has answered this model fastest lately, by its time to the first token and how fast it writes; those within a tenth of each other keep their listed order. One not measured lately gets one request in five, so it is measured again, and one that fails is passed over while it rests."],
};
// modeOf: a routing's name and what it does, a JS gateway plugin's
@@ -5155,7 +5155,7 @@ function routingPage(part) {
weight: GROUP_WEIGHT,
free: "Free first: the members whose model its vendor serves at no cost to the subscription's allowance or credits go first, then the rest — each whole, over its own accounts or keys as its provider routes them. The free ones are tried before any that spends, so nothing that costs nothing is left unused.",
fast: "Speed first: the member that answered fastest lately goes first, by its time to the first token and how fast it writes, each of its accounts or keys weighed on its own; those within a tenth keep their listed order, and one not measured lately gets one request in five, so it is measured again.",
cheap: "Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so DeepSeek's own API, at double price in its peak hours, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.",
cheap: "Cheapest first: the member whose model costs least now goes first, by its price a million tokens in and out at this hour — so a model billed double in its vendor's peak hours, as DeepSeek's own API and Ollama Cloud's DeepSeek models are, goes behind a provider charging less then, and ahead of it off-peak. Those that cost the same keep their listed order; one with no known price goes last.",
manual: "Manual: every request goes to the model you pick on the group's card, over its own accounts or keys; the others, and the rules, wait until you pick another — none takes over when it fails.",
};
// a group in the group, and a provider set to route other than Smart, is
+1 -1
View File
@@ -13,7 +13,7 @@ window.rateWindowsPaint = function paint(box, d) {
const help = el("div", "hint", t("Inside a window a call costs the official price times its rate, on top of the price rate; outside every window the price rate alone counts. The first window that holds a call wins. Times are on the clock of the computer magpie runs on, and 22:00–6:00 crosses midnight. No day ticked is every day. A price you set for a model is scaled by the window too. Changing the windows prices the calls already counted again, as a changed price rate does."));
// a list price with the vendor's own peak has it already (#2463,
// the author): a window over the same hours would double it again
help.append(el("div", "", t("DeepSeek's own API, Command Code and OpenCode Go already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.")));
help.append(el("div", "", t("DeepSeek's own API, Command Code, OpenCode Go and Ollama Cloud already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.")));
help.id = "rate-windows-help";
box.after(help);
box.setAttribute("role", "group");
@@ -27,6 +27,8 @@ function serve(lang, posts) {
// billed by the hour (treeMan on Discord): the list price is off-peak
{ id: "model-5", name: "Model 5", on: true, efforts: [], images: false, list: { ...list, peak: "deepseek" } },
{ id: "model-6", name: "Model 6", on: true, efforts: [], images: false, list: { ...list, peak: "weekdays" } },
// Ollama Cloud's: its own hours, 12:00 to 18:00 UTC (hayden4608 on Discord)
{ id: "model-7", name: "Model 7", on: true, efforts: [], images: false, list: { ...list, peak: "ollama" } },
];
const provider = { id: "relay", name: "Relay", icon: "generic", chat: "https://relay.example/v1", responses: "", anthropic: "", models, agents: [], key: { set: true, masked: "sk-…1234" }, ready: true };
const providers = { providers: [provider], presets: [], excluded: [], gateway: { running: true, window: true } };
@@ -91,6 +93,12 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.match(await row("model-5").locator(".mprice").getAttribute("title"), holiday);
assert.match(await row("model-6").locator(".mprice").getAttribute("title"), peak);
assert.doesNotMatch(await row("model-6").locator(".mprice").getAttribute("title"), holiday);
const ollama = await row("model-7").locator(".mprice").getAttribute("title");
assert.match(ollama, peak);
assert.match(ollama, zh ? /周一至周五 UTC 12:00–18:00/ : /from 12:00 to 18:00 UTC, Monday to Friday/);
assert.doesNotMatch(ollama, /01:00/);
assert.doesNotMatch(ollama, holiday);
assert.doesNotMatch(await row("model-6").locator(".mprice").getAttribute("title"), /12:00/);
// a part typed, the others the list's; Restore default drops a price
const y = await page.evaluate(() => scrollY);
@@ -105,7 +105,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert(zh.label && zh.add && zh.hint && zh.bad, "every string has its Chinese");
// the vendors whose list price has its peak already are named under
// the windows, in the page's own language
const peak = "DeepSeek's own API, Command Code and OpenCode Go already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.";
const peak = "DeepSeek's own API, Command Code, OpenCode Go and Ollama Cloud already count their DeepSeek models' peak hours at double: don't add those hours as a window, or they count twice.";
const peakText = await page.evaluate(([lang, k]) => lang === "en" ? k : I18N[lang]?.[k], [lang, peak]);
assert(peakText, "the peak note has its " + lang);
assert((await page.locator(".editor .rate-windows + .hint").innerText()).includes(peakText.trim()), "the peak note is shown");
@@ -82,7 +82,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const price = await say("{in} in, {out} out a million tokens", { in: "$0.150", out: "$0.600" });
assert.equal(await why(), await say("Cheapest first: {model} costs least on {who} now — {price}.", { who: "ollama-cloud", model: "deepseek-v4-flash", price }));
assert.equal((await page.locator(".rt-mode").textContent()).trim(),
await say("Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — DeepSeek's peak hours count double — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last."));
await say("Requests go to the member whose model costs least now, by its price a million tokens in and out at this hour — a vendor's peak hours count double where it bills them so, as DeepSeek and Ollama Cloud do — and the cheaper cache read when two cost the same; those that cost the same keep their listed order, and one with no known price goes last."));
if (lang !== "en") assert.notEqual(await say("Cheapest first"), "Cheapest first", `${lang} names Cheapest first`);
assert.deepEqual(errors, []);
});
+12 -1
View File
@@ -25,6 +25,9 @@ type peakBill struct {
// models are the ids it bills so, without a maker's prefix
// ("deepseek/"); nil: every model it serves
models []string
// tagged: a listed model with a tag after a colon is the same model
// (Ollama's dated deepseek-v4.1-flash:1017 beside deepseek-v4.1-flash)
tagged bool
}
var peakBills = []peakBill{
@@ -39,6 +42,12 @@ var peakBills = []peakBill{
// OpenCode Go's (https://opencode.ai/docs/go): Off-Peak and Peak rows
{at: func(b string) bool { return openCodeGateway(b) == "go" }, ids: []string{"opencode-go"}, peak: catalog.PeakWeekdays,
models: []string{"deepseek-v4.1-flash", "deepseek-v4-pro"}},
// Ollama Cloud's (https://ollama.com/pricing): the two models with an
// Off-Peak row, at half the price 12:00 to 18:00 UTC on weekdays,
// which models.dev lists as their price; every other model there is
// one price at every hour
{at: func(b string) bool { return HostOf(b) == "ollama.com" }, ids: []string{"ollama-cloud"}, peak: catalog.PeakOllama,
models: []string{"deepseek-v4.1-flash", "deepseek-v4-pro"}, tagged: true},
}
// PeakOf is the hours a call to model at p is billed double in, by the
@@ -58,7 +67,9 @@ func (p Provider) PeakOf(model string) catalog.Peak {
looked := false
for _, b := range peakBills {
if b.models != nil && !slices.Contains(b.models, m) {
continue
if i := strings.IndexByte(m, ':'); !b.tagged || i < 0 || !slices.Contains(b.models, m[:i]) {
continue
}
}
if !looked {
urls = buf[:0]
+127
View File
@@ -51,6 +51,21 @@ func TestPeakOf(t *testing.T) {
{"lookalike host", Provider{ID: "x", Chat: "https://api.deepseek.com.evil.example/v1"}, "deepseek-flash", ""},
{"removed deepseek", Provider{ID: "deepseek"}, "deepseek-flash", catalog.PeakDeepSeek},
{"openai", preset("openai"), "gpt-6-astra", ""},
// Ollama Cloud: the two models its pricing page gives an Off-Peak
// row, their dated tags too, and nothing else it serves
{"ollama cloud flash", preset("ollama-cloud"), "deepseek-v4.1-flash", catalog.PeakOllama},
{"ollama cloud pro", preset("ollama-cloud"), "deepseek-v4-pro", catalog.PeakOllama},
{"ollama cloud dated flash", preset("ollama-cloud"), "deepseek-v4.1-flash:1017", catalog.PeakOllama},
{"ollama cloud dated pro", preset("ollama-cloud"), "deepseek-v4-pro:0813", catalog.PeakOllama},
{"ollama cloud v4-flash", preset("ollama-cloud"), "deepseek-v4-flash", ""},
{"ollama cloud glm", preset("ollama-cloud"), "glm-5.3", ""},
{"ollama cloud gpt-oss", preset("ollama-cloud"), "gpt-oss:120b", ""},
{"ollama cloud lookalike tag", preset("ollama-cloud"), "deepseek-v4-pro-max:1", ""},
{"removed ollama cloud", Provider{ID: "ollama-cloud"}, "deepseek-v4-pro", catalog.PeakOllama},
{"ollama local", preset("ollama"), "deepseek-v4-pro", ""},
{"relay named ollama cloud", Provider{ID: "ollama-cloud", Preset: "ollama-cloud", Chat: "https://relay.example/v1"}, "deepseek-v4-pro", ""},
{"ollama lookalike host", Provider{ID: "x", Chat: "https://ollama.com.evil.example/v1"}, "deepseek-v4-pro", ""},
{"opencode go at ollama's model", preset("opencode-go"), "deepseek-v4-pro:0813", ""},
} {
if got := c.p.PeakOf(c.model); got != c.want {
t.Errorf("%s %s: %q, want %q", c.name, c.model, got, c.want)
@@ -160,6 +175,118 @@ func TestPriceOfPeak(t *testing.T) {
}
}
// ollamaCloudCatalog is models.dev's api.json as magpie had it on
// 2026-11-01, these entries byte for byte (descriptions and the like left
// out): Ollama Cloud's DeepSeek models at their Off-Peak row of
// https://ollama.com/pricing, its GLM at its one price, and DeepSeek's own
// API beside it.
const ollamaCloudCatalog = `{
"ollama-cloud":{"id":"ollama-cloud","api":"https://ollama.com/v1","name":"Ollama Cloud","models":{
"deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","cost":{"input":0.15,"output":0.6,"cache_read":0.003}},
"deepseek-v4.1-flash:1017":{"id":"deepseek-v4.1-flash:1017","cost":{"input":0.15,"output":0.6,"cache_read":0.003}},
"deepseek-v4-pro":{"id":"deepseek-v4-pro","cost":{"input":0.66,"output":1.98,"cache_read":0.022}},
"glm-5.3":{"id":"glm-5.3","cost":{"input":1.4,"output":4.4,"cache_read":0.26}}}},
"deepseek":{"id":"deepseek","api":"https://api.deepseek.com","name":"DeepSeek","models":{
"deepseek-v4-pro":{"id":"deepseek-v4-pro","cost":{"input":0.66,"output":1.98,"cache_read":0.013}}}}
}`
// Ollama Cloud's DeepSeek V4.1 Flash and V4 Pro cost their listed
// (off-peak) price outside 12:00 to 18:00 UTC on weekdays and all of
// Saturday and Sunday, and double in those hours, which is its pricing page's peak
// row ($0.30/$1.20, $1.32/$3.96). Every edge is checked a minute either
// side, on the clock of the far zones a call can be written in. Its GLM,
// and DeepSeek's own API in Ollama's peak hours, cost what they did.
func TestOllamaCloudOffPeakPrice(t *testing.T) {
home := t.TempDir()
t.Setenv("HOME", home)
t.Setenv("USERPROFILE", home)
t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config"))
t.Setenv("XDG_CACHE_HOME", filepath.Join(home, ".cache"))
if err := os.MkdirAll(filepath.Dir(catalog.CachePath()), 0o700); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(catalog.CachePath(), []byte(ollamaCloudCatalog), 0o600); err != nil {
t.Fatal(err)
}
catalog.Reset()
t.Cleanup(catalog.Reset)
oc, err := FromPreset("ollama-cloud")
if err != nil {
t.Fatal(err)
}
ds, err := FromPreset("deepseek")
if err != nil {
t.Fatal(err)
}
none := settings.Settings{}
price := func(p Provider, model string, tm time.Time) catalog.Price {
t.Helper()
pr, ok := p.PriceAt(none, model, tm)
if !ok {
t.Fatalf("%s %s: unpriced", p.ID, model)
}
return pr.In(tm)
}
zones := []*time.Location{time.UTC, time.FixedZone("+14", 14*3600), time.FixedZone("-11", -11*3600)}
utc := func(day, hm string) time.Time {
v, err := time.Parse("2006-01-02 15:04", day+" "+hm)
if err != nil {
t.Fatal(err)
}
return v
}
for _, c := range []struct {
day, hm string
peak bool
}{
{"2026-10-28", "11:59", false}, // a Wednesday
{"2026-10-28", "12:00", true},
{"2026-10-28", "17:59", true},
{"2026-10-28", "18:00", false},
{"2026-10-28", "02:00", false}, // DeepSeek's peak, not Ollama's
{"2026-10-26", "12:00", true}, // a Monday
{"2026-10-30", "17:59", true}, // a Friday
{"2026-10-05", "13:00", true}, // a Chinese holiday: Ollama names none
{"2026-10-31", "12:00", false}, // a Saturday
{"2026-11-01", "17:59", false}, // a Sunday
} {
for _, z := range zones {
tm := utc(c.day, c.hm).In(z)
name := c.day + " " + c.hm + " UTC in " + z.String()
f, pro := price(oc, "deepseek-v4.1-flash", tm), price(oc, "deepseek-v4-pro", tm)
dated := price(oc, "deepseek-v4.1-flash:1017", tm)
wantF := catalog.Price{Input: 0.15, Output: 0.6, CacheRead: 0.003}
wantP := catalog.Price{Input: 0.66, Output: 1.98, CacheRead: 0.022}
if c.peak {
wantF, wantP = wantF.Times(2), wantP.Times(2)
}
if !f.Same(wantF) || !dated.Same(wantF) {
t.Errorf("%s: flash %+v, dated %+v, want %+v", name, f, dated, wantF)
}
if !pro.Same(wantP) {
t.Errorf("%s: pro %+v, want %+v", name, pro, wantP)
}
if g := price(oc, "glm-5.3", tm); !g.Same(catalog.Price{Input: 1.4, Output: 4.4, CacheRead: 0.26}) {
t.Errorf("%s: glm-5.3 %+v, want its one price", name, g)
}
// DeepSeek's own API keeps its own hours: off-peak at Ollama's
// peak, at peak at 02:00 on a weekday that isn't a holiday
dsWant := catalog.Price{Input: 0.66, Output: 1.98, CacheRead: 0.013}
if catalog.PeakDeepSeek.At(tm) {
dsWant = dsWant.Times(2)
}
if d := price(ds, "deepseek-v4-pro", tm); !d.Same(dsWant) {
t.Errorf("%s: deepseek's own %+v, want %+v", name, d, dsWant)
}
}
}
// the page's peak row, to the cent
peak := price(oc, "deepseek-v4-pro", utc("2026-10-28", "15:00"))
if peak.Input != 1.32 || peak.Output != 3.96 || peak.CacheRead != 0.044 {
t.Errorf("deepseek-v4-pro at peak: %+v, want $1.32/$3.96/$0.044", peak)
}
}
// commandCodeCatalog is models.dev's api.json as magpie had it on
// 2026-10-30, these entries byte for byte (descriptions and the like left
// out). DeepSeek lists V4.1 Flash only as deepseek-flash, by a dated
+1 -1
View File
@@ -183,7 +183,7 @@
<tr><td>週のペース <code>pace</code></td><td>更新までの 1 時間あたりの週の枠の残りが最も多いアカウント、つまりリセット時に失う分が最も多いもの。これにより各メンバーの週の枠がリセットで無駄になりにくくなります。週の枠がなく 5 時間枠だけのアカウント(Claude Enterprise)は、更新までの 1 時間あたりの 5 時間枠の残りで判断されるので、ほぼ常に最初になります。使用率が 90% 以上のものは、他が応答できなくなるまで待ちます。キーは最近送ったトークン数で判断します。</td></tr>
<tr><td>重み順 <code>weight</code></td><td>グループ編集画面で各モデルの横に設定した重み(1〜1000、未設定は 1)に応じてリクエストを分けます。重み 3 のモデルは重み 1 のモデルが 1 件受けるごとに 3 件受け、まとめてではなく均等に散らします。各モデルは自分のプロバイダーのルーティングで自分のアカウントやキーを使い、グループ内のグループは 1 つとして数えます。失敗して休んでいるものはその回から外れ、失敗したときは次のモデルが代わりに答えます。</td></tr>
<tr><td>速度優先 <code>fast</code></td><td>このモデルに最近いちばん速く応答したメンバー、アカウント、キーが先です。最初のトークンまでの時間と出力の速さで比べ、新しい応答ほど重く数えます。差が 1 割以内のものは並び順のままです。1 時間測っていないものには 5 件に 1 件を回すので、一度遅かったチャネルもまた試されます。失敗して休んでいるものは最後です。測るのはストリーミングの応答だけで、再起動すると測り直します。</td></tr>
<tr><td>最安優先 <code>cheap</code></td><td>ルーティンググループのみ。いまモデルが最も安いメンバーが先です。Usage が数えるのと同じく、この時間帯の入力・出力 100 万トークンあたりの価格で比べます:自分で設定した価格、なければ定価に、プロバイダの価格倍率と時間帯倍率をかけたもの。DeepSeek 公式 API、Command Code と OpenCode Go の DeepSeek モデルはピーク時間帯(平日 UTC 01:00–04:00 と 06:00–10:00)に 2 倍になるので、2 つのプロバイダにある同じ DeepSeek モデルはその時間に安い方へ送られます。同じ価格のものは順番どおり、価格が分からないものは最後です。</td></tr>
<tr><td>最安優先 <code>cheap</code></td><td>ルーティンググループのみ。いまモデルが最も安いメンバーが先です。Usage が数えるのと同じく、この時間帯の入力・出力 100 万トークンあたりの価格で比べます:自分で設定した価格、なければ定価に、プロバイダの価格倍率と時間帯倍率をかけたもの。DeepSeek 公式 API、Command Code と OpenCode Go の DeepSeek モデルはピーク時間帯(平日 UTC 01:00–04:00 と 06:00–10:00)に、Ollama Cloud の DeepSeek V4.1 Flash と V4 Pro は自社のピーク時間帯(平日 UTC 12:00–18:00、それ以外は半額)に 2 倍になるので、2 つのプロバイダにある同じ DeepSeek モデルはその時間に安い方へ送られます。同じ価格のものは順番どおり、価格が分からないものは最後です。</td></tr>
</table></div>
<div class="table-wrap"><table>
<tr><th>維持</th><th>会話が、応答したアカウントやキーに留まる期間</th></tr>
+1 -1
View File
@@ -183,7 +183,7 @@
<tr><td>Weekly pace <code>pace</code></td><td>The account with the most of its week left per hour until it renews — the one with the most to lose at its reset — so less of each member’s week is lost at its reset; an account with five hours and no week (Claude Enterprise) by what its five hours have left per hour until they renew, so almost always first. One at 90% or more waits until the others can’t answer. A key by the tokens sent it lately.</td></tr>
<tr><td>By weight <code>weight</code></td><td>Each model takes its share of the requests by the weight set beside it in the group editor (1 to 1000, 1 if unset): one weighing 3 takes three for every one a model weighing 1 takes, spread out rather than in bursts. Each model is tried whole over its own accounts or keys, as its provider routes them, and a group in the group counts as one. One resting after a failure leaves the round; the next model is the fallback when one fails.</td></tr>
<tr><td>Speed first <code>fast</code></td><td>The member, account or key that answered this model fastest lately: the time to its first token and how fast it writes, newer answers counting more. Those within a tenth of each other keep their order. One not measured in the last hour gets one request in five, so a channel that was slow once is tried again; one resting after a failure goes last. Only streamed replies are measured, and a restart measures again from scratch.</td></tr>
<tr><td>Cheapest first <code>cheap</code></td><td>Groups only. The member whose model costs least now, by its price a million tokens in and out at this hour as Usage counts it: your own price for it, else its list price, at the provider’s price rate and rate windows. DeepSeek’s own API, Command Code’s and OpenCode Go’s DeepSeek models cost double in their peak hours (weekdays 01:00–04:00 and 06:00–10:00 UTC), so a DeepSeek model listed on two providers goes to the one cheaper at that hour. Members that cost the same keep their order; one with no known price goes last.</td></tr>
<tr><td>Cheapest first <code>cheap</code></td><td>Groups only. The member whose model costs least now, by its price a million tokens in and out at this hour as Usage counts it: your own price for it, else its list price, at the provider’s price rate and rate windows. DeepSeek’s own API, Command Code’s and OpenCode Go’s DeepSeek models cost double in their peak hours (weekdays 01:00–04:00 and 06:00–10:00 UTC), and Ollama Cloud’s DeepSeek V4.1 Flash and V4 Pro in its own (weekdays 12:00–18:00 UTC, half price the rest of the time), so a DeepSeek model listed on two providers goes to the one cheaper at that hour. Members that cost the same keep their order; one with no known price goes last.</td></tr>
</table></div>
<div class="table-wrap"><table>
<tr><th>Stays</th><th>How long a conversation stays with the account or key that answered it</th></tr>
+1 -1
View File
@@ -183,7 +183,7 @@
<tr><td>重置前用完 <code>pace</code></td><td>每周剩余额度除以距重置的小时数,最高的账号排第一——重置时损失最多的那个——少让成员的周额度到重置时作废;只有 5 小时额度、没有周额度的账号(如 Claude Enterprise)按 5 小时窗口的剩余额度除以距它重置的小时数算,所以几乎总排第一。用到 90% 以上的等其他账号都答不了时才用。Key 按最近发给它的 token 数排。</td></tr>
<tr><td>按权重 <code>weight</code></td><td>每个模型按群组编辑器里它旁边设的权重(1 到 1000,不设为 1)分得请求:权重 3 的模型每拿三个,权重 1 的拿一个,均匀穿插而不是成批。每个模型按它自己提供方的路由用自己的账号或 Key,群组里的群组算一个成员。失败后歇着的那个退出这一轮;一个失败时,下一个模型接上。</td></tr>
<tr><td>速度优先 <code>fast</code></td><td>最近回答这个模型最快的成员、账号或 Key 先用:看首字时间和输出速度,越新的回答算得越重。相差不到一成的保持原来的顺序。一小时内没测过的每五个请求分到一个,慢过一次的渠道还会再试;失败后歇着的排最后。只测流式回复,重启后重新测。</td></tr>
<tr><td>最便宜优先 <code>cheap</code></td><td>仅限路由组。此刻模型最便宜的成员先用,按 Usage 计费的方式算这个时段每百万输入、输出 token 的价格:你自己设的价格,否则用标价,再乘以提供方的价格倍率和分时倍率。DeepSeek 官方 API、Command Code 和 OpenCode Go 的 DeepSeek 模型在高峰时段(工作日 UTC 01:00–04:00 和 06:00–10:00)双倍计价,所以同一个 DeepSeek 模型挂在两个提供方上时,会交给这个时段更便宜的那个。价格相同的保持原来的顺序;不知道价格的排最后。</td></tr>
<tr><td>最便宜优先 <code>cheap</code></td><td>仅限路由组。此刻模型最便宜的成员先用,按 Usage 计费的方式算这个时段每百万输入、输出 token 的价格:你自己设的价格,否则用标价,再乘以提供方的价格倍率和分时倍率。DeepSeek 官方 API、Command Code 和 OpenCode Go 的 DeepSeek 模型在高峰时段(工作日 UTC 01:00–04:00 和 06:00–10:00)双倍计价,Ollama Cloud 的 DeepSeek V4.1 Flash 和 V4 Pro 则按它自己的高峰时段(工作日 UTC 12:00–18:00,其余时间半价),所以同一个 DeepSeek 模型挂在两个提供方上时,会交给这个时段更便宜的那个。价格相同的保持原来的顺序;不知道价格的排最后。</td></tr>
</table></div>
<div class="table-wrap"><table>
<tr><th>会话保持</th><th>会话在回答过它的账号或 Key 上留多久</th></tr>