feat(qwen): Alibaba Qwen built-in over Model Studio's OpenAI-compatible mode #27

Merged
steve merged 6 commits from feat/qwen-builtin into main 2026-08-12 21:03:34 +00:00
Showing only changes of commit 0760cf96d4 - Show all commits
+4 -3
View File
@@ -26,8 +26,9 @@ var ErrUnknownProvider = errors.New("unknown provider")
// authenticated with the bearer token "test-token".
type DSN struct {
// Scheme selects the provider implementation: "foreman", "ollama",
// "ollama-cloud", "openai", "kimi", "anthropic", "google"/"gemini", or
// any custom scheme registered with RegisterScheme.
// "ollama-cloud", "openai", "kimi", "qwen", "anthropic",
// "google"/"gemini", "llama-swap"/"llama-swaps", or any custom scheme
// registered with RegisterScheme.
Scheme string
// Token is the provider secret (bearer token or API key); empty = none.
Token string
@@ -41,7 +42,7 @@ type DSN struct {
func (d DSN) BaseURL() string { return "https://" + d.Host }
// envKeyForProvider returns the LLM_* variable that defines the provider named
Review

envKeyForProvider doc-comment example inverts the function's direction (LLM_M1 → "m1" is name → var backwards)

maintainability · flagged by 1 model

  • builtin.go:20 is ProviderKimi = "kimi" (padding stripped), while builtin.go:26 is ProviderQwen = "qwen" (padding retained) — inconsistent spacing within the same const block. Confirmed. - env.go:44 reads // name (LLM_M1 → "m1", so "my-prov" → LLM_MY_PROV). while the function (line 52) returns the LLM_ variable for a given name, so the first arrow LLM_M1 → "m1" inverts the actual direction. Confirmed.

🪰 Gadfly · advisory

⚪ **envKeyForProvider doc-comment example inverts the function's direction (LLM_M1 → "m1" is name → var backwards)** _maintainability · flagged by 1 model_ - `builtin.go:20` is `ProviderKimi = "kimi"` (padding stripped), while `builtin.go:26` is `ProviderQwen = "qwen"` (padding retained) — inconsistent spacing within the same const block. Confirmed. - `env.go:44` reads `// name (LLM_M1 → "m1", so "my-prov" → LLM_MY_PROV).` while the function (line 52) returns the LLM_ variable for a given name, so the first arrow `LLM_M1 → "m1"` inverts the actual direction. Confirmed. <sub>🪰 Gadfly · advisory</sub>
// name (LLM_M1 → "m1", so "my-prov" → LLM_MY_PROV).
// name: "m1" → LLM_M1, "my-prov" → LLM_MY_PROV.
//
// This is the single definition on purpose. Two call sites need byte-identical
// output and would drift apart in silence: lazy resolution reads this variable