feat(llmkeys): allow Qwen3.8-27B on tenant LiteLLM keys (#31)
Add Qwen3.8-27B to the default LITELLM_MODELS allowlist for per-tenant LiteLLM keys. Existing keys are updated separately via LiteLLM /key/update. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FKb71CELE4iptE9em1ZEgv
This commit was merged in pull request #31.
This commit is contained in:
1 parent
33ba32ef30
commit
13da983d1e
6 files changed
+7
-7
No files matched your search
@@ -56,7 +56,7 @@ Env vars (override at the shell):
|
||||
| `LICENCE_SIGNING_KEY` / `LICENCE_ISSUER` / `LICENCE_TTL_DAYS` | empty (ephemeral) / `tenant-registry` / `30` | CLI licence signer (base64 Ed25519 seed) |
|
||||
| `LITELLM_BASE_URL` | `https://llm.breakpilot.com` | LiteLLM proxy root; returned to Werkpilot as `llm_base_url` |
|
||||
| `LITELLM_MASTER_KEY` | empty (LLM keys off — logged once at start) | LiteLLM admin key for `/key/generate` + `/key/delete` (secret) |
|
||||
| `LITELLM_MODELS` | `Qwen3-Coder-30B-A3B-Instruct,gpt-oss-120b` | Comma list of models a tenant key may call |
|
||||
| `LITELLM_MODELS` | `Qwen3-Coder-30B-A3B-Instruct,gpt-oss-120b,Qwen3.8-27B` | Comma list of models a tenant key may call |
|
||||
| `LITELLM_BUDGET_TRIAL` / `LITELLM_BUDGET_DEFAULT` | `5` / `50` | USD per 30 days (`budget_duration: 30d`) for trial / paying tenants |
|
||||
|
||||
## Endpoints
|
||||
|
||||
@@ -120,7 +120,7 @@ func Load() (*Config, error) {
|
||||
|
||||
LiteLLMBaseURL: getenv("LITELLM_BASE_URL", "https://llm.breakpilot.com"),
|
||||
LiteLLMMasterKey: os.Getenv("LITELLM_MASTER_KEY"),
|
||||
LiteLLMModels: getlist("LITELLM_MODELS", []string{"Qwen3-Coder-30B-A3B-Instruct", "gpt-oss-120b"}),
|
||||
LiteLLMModels: getlist("LITELLM_MODELS", []string{"Qwen3-Coder-30B-A3B-Instruct", "gpt-oss-120b", "Qwen3.8-27B"}),
|
||||
LiteLLMBudgetTrial: getfloat("LITELLM_BUDGET_TRIAL", 5),
|
||||
LiteLLMBudgetDefault: getfloat("LITELLM_BUDGET_DEFAULT", 50),
|
||||
}, nil
|
||||
|
||||
@@ -61,7 +61,7 @@ func TestLoad_litellmDefaultsAndOverrides(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if cfg.LiteLLMBaseURL != "https://llm.breakpilot.com" || cfg.LiteLLMMasterKey != "" ||
|
||||
len(cfg.LiteLLMModels) != 2 || cfg.LiteLLMModels[0] != "Qwen3-Coder-30B-A3B-Instruct" || cfg.LiteLLMModels[1] != "gpt-oss-120b" ||
|
||||
len(cfg.LiteLLMModels) != 3 || cfg.LiteLLMModels[0] != "Qwen3-Coder-30B-A3B-Instruct" || cfg.LiteLLMModels[1] != "gpt-oss-120b" || cfg.LiteLLMModels[2] != "Qwen3.8-27B" ||
|
||||
cfg.LiteLLMBudgetTrial != 5 || cfg.LiteLLMBudgetDefault != 50 {
|
||||
t.Errorf("litellm defaults: %+v", cfg)
|
||||
}
|
||||
@@ -82,7 +82,7 @@ func TestLoad_litellmDefaultsAndOverrides(t *testing.T) {
|
||||
}
|
||||
// a list of only separators falls back to the default
|
||||
t.Setenv("LITELLM_MODELS", " , ")
|
||||
if cfg, _ = Load(); len(cfg.LiteLLMModels) != 2 {
|
||||
if cfg, _ = Load(); len(cfg.LiteLLMModels) != 3 {
|
||||
t.Errorf("blank list should fall back: %v", cfg.LiteLLMModels)
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ const (
|
||||
)
|
||||
|
||||
// DefaultModels are the models tenant keys may call.
|
||||
var DefaultModels = []string{"Qwen3-Coder-30B-A3B-Instruct", "gpt-oss-120b"}
|
||||
var DefaultModels = []string{"Qwen3-Coder-30B-A3B-Instruct", "gpt-oss-120b", "Qwen3.8-27B"}
|
||||
|
||||
// ErrDisabled — no master key configured.
|
||||
var ErrDisabled = errors.New("llmkeys: disabled (no master key)")
|
||||
|
||||
@@ -59,7 +59,7 @@ func TestClient_generateAndDelete(t *testing.T) {
|
||||
if !c.Enabled() || c.BaseURL() != srv.URL || c.Budget(true) != DefaultBudgetTrial || c.Budget(false) != DefaultBudgetDefault || c.BudgetDuration() != DefaultBudgetDuration {
|
||||
t.Fatalf("defaults: %+v", c.cfg)
|
||||
}
|
||||
if m := c.Models(); len(m) != 2 || m[0] != DefaultModels[0] {
|
||||
if m := c.Models(); len(m) != len(DefaultModels) || m[0] != DefaultModels[0] || m[len(m)-1] != "Qwen3.8-27B" {
|
||||
t.Fatalf("models: %v", m)
|
||||
}
|
||||
k, err := c.Generate(context.Background(), GenerateRequest{
|
||||
|
||||
@@ -104,7 +104,7 @@ func TestLicences_llmKey_issueRenewRevoke(t *testing.T) {
|
||||
if g["key_alias"] != "werkpilot-llm-co-"+lic.ID || g["max_budget"] != 5.0 || g["budget_duration"] != "30d" {
|
||||
t.Fatalf("generate body: %+v", g)
|
||||
}
|
||||
if models, _ := g["models"].([]any); len(models) != 2 || models[0] != "Qwen3-Coder-30B-A3B-Instruct" || models[1] != "gpt-oss-120b" {
|
||||
if models, _ := g["models"].([]any); len(models) != 3 || models[0] != "Qwen3-Coder-30B-A3B-Instruct" || models[1] != "gpt-oss-120b" || models[2] != "Qwen3.8-27B" {
|
||||
t.Fatalf("models: %v", g["models"])
|
||||
}
|
||||
md, _ := g["metadata"].(map[string]any)
|
||||
|
||||
Reference in new issue
Block a user