Drop the three-layer Claude subprocess orchestration (local model →
Claude verifier → cloud escalation). Skills now call LiteLLM directly
and return plain text to Claude Code, which decides what to do with it.
- Delete executor, orchestrator, verifier, result, attempts packages
- Simplify LiteLLMExecutor: Run(Request)→Result becomes Complete(model,sys,user)→(string,int64,error)
- Replace ExecutorFn with CompleteFunc in all 6 skill configs
- Rewrite all skill handlers to call Complete and return {"text","model","duration_ms"}
- Simplify config/models: remove Verifier/LlamaSwapURL, add ModelFor
- Bump version to v0.5.0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
50 lines
1.0 KiB
Go
50 lines
1.0 KiB
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"gopkg.in/yaml.v3"
|
|
)
|
|
|
|
type skillChain struct {
|
|
Chain []string `yaml:"chain"`
|
|
}
|
|
|
|
type modelsFile struct {
|
|
DefaultChain []string `yaml:"default_chain"`
|
|
Skills map[string]skillChain `yaml:"skills"`
|
|
}
|
|
|
|
type Models struct {
|
|
data modelsFile
|
|
}
|
|
|
|
func LoadModels(path string) (Models, error) {
|
|
raw, err := os.ReadFile(path)
|
|
if err != nil {
|
|
return Models{}, fmt.Errorf("load models: %w", err)
|
|
}
|
|
var f modelsFile
|
|
if err := yaml.Unmarshal(raw, &f); err != nil {
|
|
return Models{}, fmt.Errorf("parse models: %w", err)
|
|
}
|
|
return Models{data: f}, nil
|
|
}
|
|
|
|
// ModelFor returns the primary model to use for a skill.
|
|
// If override is non-empty, it is returned directly.
|
|
// Falls back to default_chain[0] when the skill has no explicit entry.
|
|
func (m Models) ModelFor(skill, override string) string {
|
|
if override != "" {
|
|
return override
|
|
}
|
|
if sc, ok := m.data.Skills[skill]; ok && len(sc.Chain) > 0 {
|
|
return sc.Chain[0]
|
|
}
|
|
if len(m.data.DefaultChain) > 0 {
|
|
return m.data.DefaultChain[0]
|
|
}
|
|
return ""
|
|
}
|