LLMIFY THIS MOFO
CI / Test (push) Successful in 58s

This commit is contained in:
2026-09-01 01:09:59 -04:00
parent dad09d1109
commit c89ff2b68e
18 changed files with 288 additions and 41 deletions
+19 -2
View File
@@ -31,8 +31,9 @@ type Config struct {
Language string
Model string
Keywords []string
Threads int // CPU threads for local transcription (0 = auto)
Streaming bool // use streaming mode if model supports it
Threads int // CPU threads for local transcription (0 = auto)
Streaming bool // use streaming mode if model supports it
BaseURL string // OpenAI-compatible base URL, without /v1
}
// NewTranscriber creates a new transcriber based on model metadata
@@ -55,6 +56,22 @@ func NewTranscriber(config Config) (Transcriber, error) {
return nil, fmt.Errorf("%s API key required", cases.Title(language.English).String(registryProvider))
}
// llama-swap proxies arbitrary OpenAI-compatible model IDs, so models are
// intentionally configured by the user rather than limited to this registry.
if registryProvider == provider.ProviderLlamaSwap {
if config.Model == "" {
return nil, fmt.Errorf("model is required for llama-swap")
}
if config.BaseURL == "" {
return nil, fmt.Errorf("llama-swap base_url required")
}
if config.Streaming {
return nil, fmt.Errorf("llama-swap transcription currently supports batch mode only (set streaming = false)")
}
endpoint := &provider.EndpointConfig{BaseURL: config.BaseURL}
return NewSimpleTranscriber(config, NewOpenAIAdapter(endpoint, config.APIKey, config.Model, config.Language, config.Keywords, registryProvider)), nil
}
// lookup model from provider
model, err := provider.GetModel(registryProvider, config.Model)
if err != nil {