Documentation
¶
Overview ¶
Package config provides centralized configuration management for llm-compiler. It handles environment variables, default values, and configuration validation.
Index ¶
- Constants
- func Reset()
- type Config
- func (c *Config) Validate() error
- func (c *Config) WithDebug(debug, verbose bool) *Config
- func (c *Config) WithLlama(modelPath string, threads int) *Config
- func (c *Config) WithOpenAI(apiKey, baseURL, model string) *Config
- func (c *Config) WithOutput(fmtOutput, llamaOutput string) *Config
- func (c *Config) WithSubprocess(enabled bool) *Config
Constants ¶
View Source
const ( DefaultOpenAIModel = "gpt-4" DefaultOpenAIBaseURL = "https://api.openai.com/v1" DefaultLlamaThreads = 4 DefaultWorkerTimeout = 300 DefaultMaxRetries = 3 DefaultFmtOutputFile = "fmt_output.txt" DefaultLlamaOutputFile = "llama_output.txt" )
Default values
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// OpenAI settings
OpenAIAPIKey string
OpenAIBaseURL string
OpenAIModel string
// Llama settings
LlamaModelPath string
LlamaThreads int
// Runtime settings
UseSubprocess bool
WorkerTimeout int // seconds
MaxRetries int
// Output settings
FmtOutputFile string
LlamaOutputFile string
Verbose bool
DebugMode bool
}
Config holds all configuration settings for llm-compiler
func Get ¶
func Get() *Config
Get returns the global configuration, loading from environment if not already loaded
func NewConfig ¶
func NewConfig() *Config
NewConfig creates a new configuration with custom values This is useful for testing or programmatic configuration
func (*Config) WithOpenAI ¶
WithOpenAI configures OpenAI settings
func (*Config) WithOutput ¶
WithOutput configures output file paths
func (*Config) WithSubprocess ¶
WithSubprocess enables subprocess mode
Click to show internal directories.
Click to hide internal directories.