Documentation
¶
Index ¶
- func Exists(cpPath string) bool
- func GenerateAndUpdateConfigFile(cpRepoPath string, multiAddress, nodeName string, port int) error
- func GetInferenceApiKey(cpRepoPath string) string
- func InitConfig(cpRepoPath string, standalone bool) error
- func LoadModelsJson(cpRepoPath string) (map[string]ModelConfig, error)
- func UpdateInferenceConfig(cpRepoPath, apiKey string, models []string) error
- func WriteModelsJson(cpRepoPath string, models map[string]ModelConfig) error
- type API
- type ComputeNode
- type Inference
- type ModelConfig
- type Pricing
- type RPC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInferenceApiKey ¶
GetInferenceApiKey returns the configured Inference API key
func InitConfig ¶
func LoadModelsJson ¶
func LoadModelsJson(cpRepoPath string) (map[string]ModelConfig, error)
LoadModelsJson loads the models.json file
func UpdateInferenceConfig ¶
UpdateInferenceConfig updates the Inference section in config.toml
func WriteModelsJson ¶
func WriteModelsJson(cpRepoPath string, models map[string]ModelConfig) error
WriteModelsJson writes the models.json file from model configurations
Types ¶
type API ¶
type API struct {
Port int
MultiAddress string
Domain string
NodeName string
Pricing Pricing `toml:"pricing"`
AutoDeleteImage bool `toml:"AutoDeleteImage"`
ClearLogDuration int `toml:"ClearLogDuration"`
PortRange []string `toml:"PortRange"`
GpuUtilizationRejectThreshold float64 `toml:"GpuUtilizationRejectThreshold"`
}
type ComputeNode ¶
type ComputeNode struct {
API API
RPC RPC `toml:"RPC,omitempty"`
Inference Inference `toml:"Inference,omitempty"`
}
ComputeNode is a compute node config
func GetConfig ¶
func GetConfig() *ComputeNode
type Inference ¶
type Inference struct {
Enable bool `toml:"Enable"`
ServiceURL string `toml:"ServiceURL"` // HTTP API URL (e.g., http://localhost:8080)
WebSocketURL string `toml:"WebSocketURL"` // WebSocket URL (e.g., wss://inference-ws.swanchain.io)
ApiKey string `toml:"ApiKey"` // Provider API key for authentication (sk-prov-*)
Models []string `toml:"Models"` // Models this provider serves
}
Inference is the Swan Inference marketplace configuration (default mode)
type ModelConfig ¶
type ModelConfig struct {
Container string `json:"container,omitempty"`
Endpoint string `json:"endpoint"`
GPUMemory int `json:"gpu_memory"`
Category string `json:"category"`
LocalModel string `json:"local_model,omitempty"`
}
ModelConfig represents a model configuration for models.json
Click to show internal directories.
Click to hide internal directories.