Repository navigation
Commit 413a87f
authored
fix(pricing): price StepFun step-5-preview from the supplemental set (#1874)
Sessions that persist the model `step-5-preview` come back unpriced. The pinned LiteLLM snapshot (`litellm-6417938744b4`) has no `stepfun` entries, and the periodic refresh can't fix it until upstream lists the model, so I added a curated supplemental row in `internal/pricing/supplemental.go` following the existing `kimi-k3` rows. Both `step-5-preview` and `stepfun/step-5-preview` resolve to it through the canonical fallback. Like the other supplemental rows it's a fallback rather than a pin, so a later LiteLLM refresh replaces it once upstream publishes the model.
The rates are the published USD list prices from StepFun's Open Platform rate card, <https://platform.stepfun.ai/docs/en/guides/pricing/details>, which I read on 2026-09-21: input $1.00 per MTok on a cache miss, cache read $0.05, output $2.70. The same page notes the cache-miss input price includes writing new content to the cache, so cache creation uses the input rate instead of a separate number. StepFun also publishes a CNY card at `platform.stepfun.com`; I used the international USD card because the catalog is denominated in dollars.
A row added to `supplementalPricing` alone wouldn't reach archives that are already seeded, because `supplementalVersion` is folded into `pricing.SeedVersion` and the startup seed skips when the stored `_fallback_version` matches. I bumped it from 4 to 5 so the mismatch makes `SeedFallback` upsert the fallback set and pick up the new row without a resync.
The regression tests fail before the change: `Resolve` finds no pricing for either spelling, and a database holding `+supplemental-4` doesn't gain the row. Reviewer focus is the rate mapping in `supplemental.go` and the version bump.
Fixes #1862
Co-authored-by: Tung Lam <[email protected]>1 parent 13ec495 commit 413a87f
4 files changed
Lines changed: 84 additions & 2 deletions
File tree
- cmd/agentsview
- docs
- internal/pricing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
68 | 91 | | |
69 | 92 | | |
70 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
231 | 243 | | |
232 | 244 | | |
233 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
55 | 99 | | |
56 | 100 | | |
57 | 101 | | |
| |||
0 commit comments