diff --git a/.env.example b/.env.example index a46d5ef..49076f5 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,6 @@ # Supervisor MCP server SUPERVISOR_PORT=3200 SUPERVISOR_CONFIG_DIR=./config/supervisor -SUPERVISOR_MODELS_FILE=./config/models.yaml # LiteLLM gateway (iguana) LITELLM_BASE_URL=http://iguana:4000 diff --git a/config/models.yaml b/config/models.yaml deleted file mode 100644 index 949f94a..0000000 --- a/config/models.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Model selection — first entry per skill is used. -# Override per-call by passing model in the MCP tool args. -# Model names come from LiteLLM /v1/models (host/name format). - -default_chain: - - iguana/qwen3-coder-next - -skills: - tdd: - chain: - - koala/qwen3-coder-30b - review: - chain: - - iguana/devstral - debug: - chain: - - iguana/deepseek-r1-14b - spec: - chain: - - koala/phi4-14b - retrospective: - chain: - - iguana/qwen3-coder-next - trainer: - chain: - - iguana/qwen3-coder-next diff --git a/internal/config/config.go b/internal/config/config.go index 1da69de..d120c6f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -7,7 +7,6 @@ type Config struct { LiteLLMBaseURL string // LITELLM_BASE_URL, default http://iguana:4000 LiteLLMAPIKey string // LITELLM_API_KEY ConfigDir string // SUPERVISOR_CONFIG_DIR, default ./config/supervisor - ModelsFile string // SUPERVISOR_MODELS_FILE, default /../models.yaml IngestBaseURL string // INGEST_BASE_URL, default http://localhost:3300 IngestSvcURL string // INGEST_SVC_URL — base URL for brain_ingest (/ingest, /ingest-path) KBRetrievalURL string // KB_RETRIEVAL_URL — base URL for brain_search @@ -23,7 +22,6 @@ func Load() (Config, error) { LiteLLMAPIKey: os.Getenv("LITELLM_API_KEY"), ConfigDir: envOr("SUPERVISOR_CONFIG_DIR", "./config/supervisor"), } - cfg.ModelsFile = envOr("SUPERVISOR_MODELS_FILE", cfg.ConfigDir+"/../models.yaml") cfg.IngestBaseURL = envOr("INGEST_BASE_URL", "http://localhost:3300") cfg.IngestSvcURL = envOr("INGEST_SVC_URL", "") cfg.KBRetrievalURL = envOr("KB_RETRIEVAL_URL", "") diff --git a/internal/config/models.go b/internal/config/models.go deleted file mode 100644 index fefed6c..0000000 --- a/internal/config/models.go +++ /dev/null @@ -1,49 +0,0 @@ -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 "" -} diff --git a/internal/config/models_test.go b/internal/config/models_test.go deleted file mode 100644 index 7772daf..0000000 --- a/internal/config/models_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package config_test - -import ( - "os" - "path/filepath" - "testing" - - "git.d-ma.be/mathias/hyperguild/internal/config" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -const testYAML = ` -default_chain: - - ollama/qwen3-coder-30b-tuned - - claude-sonnet-4-6 - -skills: - review: - chain: - - ollama/devstral-tuned - - ollama/gemma4 - - claude-sonnet-4-6 - spec: - chain: - - ollama/phi4 - - claude-opus-4-6 -` - -func writeModels(t *testing.T, content string) string { - t.Helper() - f := filepath.Join(t.TempDir(), "models.yaml") - require.NoError(t, os.WriteFile(f, []byte(content), 0o644)) - return f -} - -func TestModelsModelForSkillWithEntry(t *testing.T) { - m, err := config.LoadModels(writeModels(t, testYAML)) - require.NoError(t, err) - assert.Equal(t, "ollama/devstral-tuned", m.ModelFor("review", "")) -} - -func TestModelsModelForDefaultFallback(t *testing.T) { - m, err := config.LoadModels(writeModels(t, testYAML)) - require.NoError(t, err) - assert.Equal(t, "ollama/qwen3-coder-30b-tuned", m.ModelFor("trainer", "")) -} - -func TestModelsModelForCallerOverride(t *testing.T) { - m, err := config.LoadModels(writeModels(t, testYAML)) - require.NoError(t, err) - assert.Equal(t, "claude-opus-4-6", m.ModelFor("review", "claude-opus-4-6")) -}