Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogToStdoutProxy = "proxy" LogToStdoutUpstream = "upstream" LogToStdoutBoth = "both" LogToStdoutNone = "none" )
View Source
const DEFAULT_GROUP_ID = "(default)"
Variables ¶
This section is empty.
Functions ¶
func SanitizeCommand ¶
func StripComments ¶
Types ¶
type Config ¶
type Config struct {
HealthCheckTimeout int `yaml:"healthCheckTimeout"`
LogRequests bool `yaml:"logRequests"`
LogLevel string `yaml:"logLevel"`
LogTimeFormat string `yaml:"logTimeFormat"`
LogToStdout string `yaml:"logToStdout"`
MetricsMaxInMemory int `yaml:"metricsMaxInMemory"`
Models map[string]ModelConfig `yaml:"models"` /* key is model ID */
Profiles map[string][]string `yaml:"profiles"`
Groups map[string]GroupConfig `yaml:"groups"` /* key is group ID */
// for key/value replacements in model's cmd, cmdStop, proxy, checkEndPoint
Macros MacroList `yaml:"macros"`
// automatic port assignments
StartPort int `yaml:"startPort"`
// hooks, see: #209
Hooks HooksConfig `yaml:"hooks"`
// send loading state in reasoning
SendLoadingState bool `yaml:"sendLoadingState"`
// present aliases to /v1/models OpenAI API listing
IncludeAliasesInList bool `yaml:"includeAliasesInList"`
// support API keys, see issue #433, #50, #251
RequiredAPIKeys []string `yaml:"apiKeys"`
// support remote peers, see issue #433, #296
Peers PeerDictionaryConfig `yaml:"peers"`
// contains filtered or unexported fields
}
func AddDefaultGroupToConfig ¶
rewrites the yaml to include a default group with any orphaned models
func LoadConfig ¶
func (*Config) FindConfig ¶
func (c *Config) FindConfig(modelName string) (ModelConfig, string, bool)
type GroupConfig ¶
type GroupConfig struct {
Swap bool `yaml:"swap"`
Exclusive bool `yaml:"exclusive"`
Persistent bool `yaml:"persistent"`
Members []string `yaml:"members"`
}
func (*GroupConfig) UnmarshalYAML ¶
func (c *GroupConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
set default values for GroupConfig
type HookOnStartup ¶
type HookOnStartup struct {
Preload []string `yaml:"preload"`
}
type HooksConfig ¶
type HooksConfig struct {
OnStartup HookOnStartup `yaml:"on_startup"`
}
type MacroEntry ¶
type MacroList ¶
type MacroList []MacroEntry
func (MacroList) MarshalYAML ¶
MarshalYAML cannot guarantee the order because it returns map[string]any
type ModelConfig ¶
type ModelConfig struct {
Cmd string `yaml:"cmd"`
CmdStop string `yaml:"cmdStop"`
Proxy string `yaml:"proxy"`
Aliases []string `yaml:"aliases"`
Env []string `yaml:"env"`
CheckEndpoint string `yaml:"checkEndpoint"`
UnloadAfter int `yaml:"ttl"`
Unlisted bool `yaml:"unlisted"`
UseModelName string `yaml:"useModelName"`
// #179 for /v1/models
Name string `yaml:"name"`
Description string `yaml:"description"`
// Limit concurrency of HTTP requests to process
ConcurrencyLimit int `yaml:"concurrencyLimit"`
// Model filters see issue #174
Filters ModelFilters `yaml:"filters"`
// Macros: see #264
// Model level macros take precedence over the global macros
Macros MacroList `yaml:"macros"`
// Metadata: see #264
// Arbitrary metadata that can be exposed through the API
Metadata map[string]any `yaml:"metadata"`
// override global setting
SendLoadingState *bool `yaml:"sendLoadingState"`
}
func (*ModelConfig) SanitizedCommand ¶
func (m *ModelConfig) SanitizedCommand() ([]string, error)
func (*ModelConfig) UnmarshalYAML ¶
func (m *ModelConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type ModelFilters ¶
type ModelFilters struct {
StripParams string `yaml:"stripParams"`
}
ModelFilters see issue #174
func (ModelFilters) SanitizedStripParams ¶
func (f ModelFilters) SanitizedStripParams() ([]string, error)
func (*ModelFilters) UnmarshalYAML ¶
func (m *ModelFilters) UnmarshalYAML(unmarshal func(interface{}) error) error
type PeerConfig ¶
type PeerConfig struct {
Proxy string `yaml:"proxy"`
ProxyURL *url.URL `yaml:"-"`
ApiKey string `yaml:"apiKey"`
Models []string `yaml:"models"`
}
func (*PeerConfig) UnmarshalYAML ¶
func (c *PeerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type PeerDictionaryConfig ¶
type PeerDictionaryConfig map[string]PeerConfig
Click to show internal directories.
Click to hide internal directories.