modelconfig

package
v0.5.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TypeChat      = "chat"
	TypeImageWS   = "image_ws"
	TypeImageLite = "image_lite"
	TypeImageEdit = "image_edit"
	TypeVideo     = "video"
)

Internal runtime type constants.

View Source
const (
	PoolBasic = "basic"
	PoolSuper = "super"
	PoolHeavy = "heavy"
)

Pool floor constants.

Variables

View Source
var EmbeddedFS embed.FS

Functions

func DerivePublicType

func DerivePublicType(internalType string) string

DerivePublicType maps an internal runtime type to its public API type.

func Load

func Load(embeddedFS fs.FS, externalPath string) ([]ModelSpec, []ModeSpec, error)

Load loads the model catalog from the embedded FS or an external file. Returns validated model specs (with PublicType derived), mode specs, or an error.

Types

type ModeSpec

type ModeSpec struct {
	ID            string         `toml:"id"`
	UpstreamName  string         `toml:"upstream_name"`
	WindowSeconds int            `toml:"window_seconds"`
	DefaultQuota  map[string]int `toml:"default_quota"`         // pool -> default quota
	LocalQuota    bool           `toml:"local_quota,omitempty"` // skip upstream rate-limits sync
}

ModeSpec represents a quota mode entry in the static catalog.

type ModelSpec

type ModelSpec struct {
	ID              string `toml:"id"`
	DisplayName     string `toml:"display_name"`
	Type            string `toml:"type"`
	Enabled         bool   `toml:"enabled"`
	PoolFloor       string `toml:"pool_floor"`
	Mode            string `toml:"mode,omitempty"`
	QuotaSync       *bool  `toml:"quota_sync,omitempty"`
	CooldownSeconds int    `toml:"cooldown_seconds,omitempty"`
	UpstreamModel   string `toml:"upstream_model,omitempty"`
	UpstreamMode    string `toml:"upstream_mode,omitempty"`
	ForceThinking   bool   `toml:"force_thinking,omitempty"`
	EnablePro       bool   `toml:"enable_pro,omitempty"`

	PublicType string `toml:"-"` // derived at load time, not serialized
}

ModelSpec represents a single model entry in the static catalog.

func (*ModelSpec) IsQuotaTracked

func (m *ModelSpec) IsQuotaTracked() bool

IsQuotaTracked reports whether the model participates in mode quota tracking. Default is true (QuotaSync nil); only explicit quota_sync = false opts out.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL