provider: Open Design's deepseek-v4.1-flash-eco is priced as DeepSeek V4.1 Flash (Winnie7572 on X, #6352)

Open Design says deepseek-v4.1-flash-eco is "same weights as DeepSeek
V4.1 Flash" on a low-priority schedule, and the plugin's models.mjs seeds
it as the same model. No catalog lists the -eco id, so after 1ca2c62c4
priced deepseek-v4.1-flash its eco twin still showed no estimated cost.
listPriceIn now prices it at the plugin provider's own price of
deepseek-v4.1-flash (openDesignSame), only when the provider is the
Open Design plugin (PluginProvider() == "opendesign"). Any other
provider's -eco id, a relay's or another plugin's, stays as it was, and
only the one id Open Design named is mapped, not every -eco.

Run (mote, at this tree): go test -count=1 for internal/provider,
catalog, usage, gui; go vet darwin, windows, linux nogui for provider
and usage. New TestOpenDesignEcoPricedAsFlash is red with the
openDesignSamePrice call disabled by hand (eco unpriced). It checks a
relay, a bare "opendesign" with no plugin account and another plugin
leave the eco id unpriced, and deepseek-v4-pro-eco stays unpriced.
Not tried: a live Open Design account's Usage page.
This commit is contained in:
yetone
2026-11-13 13:15:31 +08:00
parent acced81418
commit 4545790de6
2 changed files with 68 additions and 0 deletions
+28
View File
@@ -2397,6 +2397,9 @@ func (p Provider) listPriceIn(c priceCats, model string) (catalog.Price, bool, i
if pr, ok := p.grokFastPrice(model); ok {
return pr, true, pricedOwn
}
if pr, ok := p.openDesignSamePrice(model); ok {
return pr, true, pricedOwn
}
// the names on the stack: made for each model priced, they were
// 1.5 MB of forty Providers asks
var buf [4]string
@@ -2614,6 +2617,31 @@ func (p Provider) grokFastPrice(model string) (catalog.Price, bool) {
return pr.Times(GrokFastTimes), true
}
// openDesignSame are the Open Design plugin's ids of a model it serves
// under another of its ids too, on another schedule: deepseek-v4.1-flash-eco
// is DeepSeek V4.1 Flash on the low-priority, high-quota schedule, the same
// weights ("Yes, same weights as DeepSeek V4.1 Flash", Open Design on X,
// read 2026-11-13; the plugin's models.mjs seeds it as the same model). No
// catalog lists the -eco id, so its calls had no estimated cost (#6352,
// Winnie7572 on X).
var openDesignSame = map[string]string{"deepseek-v4.1-flash-eco": "deepseek-v4.1-flash"}
// openDesignSamePrice is an Open Design model's price as the model it is
// the same as (openDesignSame), on the Open Design plugin only: elsewhere
// an -eco id is another vendor's to price.
func (p Provider) openDesignSamePrice(model string) (catalog.Price, bool) {
if p.PluginProvider() != "opendesign" {
return catalog.Price{}, false
}
m := strings.ToLower(strings.TrimSpace(model))
m = strings.TrimPrefix(m, "opendesign/")
base, ok := openDesignSame[m]
if !ok {
return catalog.Price{}, false
}
return p.ListPrice(base)
}
// GrokFastTimes is how many times its model's price xAI sells a Grok
// model's fast variant at (grokFastPrice).
const GrokFastTimes = 2
@@ -6,6 +6,7 @@ import (
"testing"
"github.com/yetone/magpie/internal/catalog"
"github.com/yetone/magpie/internal/plugin"
)
// A relay that serves DeepSeek's V4.1 Flash under the id the maker's
@@ -46,3 +47,42 @@ func TestRelayDeepSeekSnapshotCanonicalPriced(t *testing.T) {
}
}
}
// Open Design's deepseek-v4.1-flash-eco is DeepSeek V4.1 Flash on its eco
// schedule, the same weights, so its estimated cost is V4.1 Flash's (#6352,
// Winnie7572 on X). Only on the Open Design plugin: the id elsewhere, or
// any other -eco id, stays unpriced.
func TestOpenDesignEcoPricedAsFlash(t *testing.T) {
claudeHome(t)
b, err := os.ReadFile("testdata/models_dev_opendesign.json")
if err != nil {
t.Fatal(err)
}
os.MkdirAll(filepath.Dir(catalog.CachePath()), 0o755)
os.WriteFile(catalog.CachePath(), b, 0o644)
catalog.Reset()
t.Cleanup(catalog.Reset)
od := Provider{ID: "opendesign", Name: "Open Design", Account: &Account{plugin: &plugin.Provider{ID: "opendesign"}}}
flash, ok := od.ListPrice("deepseek-v4.1-flash")
if !ok || flash.Input != 0.15 || flash.Output != 0.6 || flash.CacheRead != 0.003 {
t.Fatalf("opendesign deepseek-v4.1-flash: %+v %v", flash, ok)
}
for _, m := range []string{"deepseek-v4.1-flash-eco", "DeepSeek-V4.1-Flash-Eco", "opendesign/deepseek-v4.1-flash-eco"} {
if pr, ok := od.ListPrice(m); !ok || pr.Input != flash.Input || pr.Output != flash.Output || pr.CacheRead != flash.CacheRead {
t.Errorf("opendesign %s: %+v %v; want V4.1 Flash's %+v", m, pr, ok, flash)
}
}
if pr, ok := od.ListPrice("deepseek-v4-pro-eco"); ok {
t.Errorf("opendesign deepseek-v4-pro-eco priced %+v", pr)
}
// no other vendor's id changes
for _, p := range []Provider{
{ID: "relay", Chat: "https://relay.example/v1"},
{ID: "opendesign"},
{ID: "other", Account: &Account{plugin: &plugin.Provider{ID: "other"}}},
} {
if pr, ok := p.ListPrice("deepseek-v4.1-flash-eco"); ok {
t.Errorf("%s deepseek-v4.1-flash-eco priced %+v", p.ID, pr)
}
}
}