mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-09-20 08:57:57 +00:00
feat(auto): AUTO-only priority chain with tiered slots + live source probing; CSV export w/ key names; audit persistence; fix prompt token accounting & deepseek thinking
This commit is contained in:
@ -121,9 +121,11 @@ func (c *Config) ApplyDefaults() error {
|
||||
|
||||
// RuntimeConfig is the persisted web-UI editable slice (sources added/edited).
|
||||
type RuntimeConfig struct {
|
||||
Sources []Source `json:"sources"`
|
||||
Keys []GWKey `json:"keys,omitempty"`
|
||||
Auto []ModelScope `json:"auto,omitempty"`
|
||||
Sources []Source `json:"sources"`
|
||||
DeletedSources []string `json:"deleted_sources,omitempty"`
|
||||
DeletedAdapters []string `json:"deleted_adapters,omitempty"`
|
||||
Keys []GWKey `json:"keys,omitempty"`
|
||||
Auto []ModelScope `json:"auto,omitempty"`
|
||||
}
|
||||
|
||||
// GWKey is a gateway API key persisted in the runtime store. Role is "admin"
|
||||
@ -144,6 +146,8 @@ type GWKey struct {
|
||||
// uses Hours as the window length in hours.
|
||||
type ModelScope struct {
|
||||
Model string `json:"model"`
|
||||
Source string `json:"source,omitempty"` // optional: pin to one upstream source; "" = any source
|
||||
Tier int `json:"tier,omitempty"`
|
||||
TokenQuota int64 `json:"token_quota"`
|
||||
Period string `json:"period,omitempty"`
|
||||
Hours int64 `json:"hours,omitempty"`
|
||||
@ -160,6 +164,8 @@ func (m *ModelScope) UnmarshalJSON(b []byte) error {
|
||||
}
|
||||
var o struct {
|
||||
Model string `json:"model"`
|
||||
Source string `json:"source"`
|
||||
Tier int `json:"tier"`
|
||||
TokenQuota int64 `json:"token_quota"`
|
||||
Period string `json:"period"`
|
||||
Hours int64 `json:"hours"`
|
||||
@ -168,6 +174,8 @@ func (m *ModelScope) UnmarshalJSON(b []byte) error {
|
||||
return err
|
||||
}
|
||||
m.Model = o.Model
|
||||
m.Source = o.Source
|
||||
m.Tier = o.Tier
|
||||
m.TokenQuota = o.TokenQuota
|
||||
m.Period = o.Period
|
||||
m.Hours = o.Hours
|
||||
|
||||
Reference in New Issue
Block a user