providers: oMLX is a local-server preset — its :8000 server speaks Chat, Responses and Anthropic Messages and asks no key on a loopback bind, so it joins Ollama and LM Studio in the add sheet's On this machine section instead of being typed as a custom provider (no issue: the gap was simply that oMLX, an OpenAI-compatible MLX server for Apple Silicon, was missing a preset). TestOmlxPreset fails without the change (no omlx preset). go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass but for TestBunThroughBridge, which fails on a clean tree too (a local bun, unrelated to this change). (#635)

This commit is contained in:
erlinerd
2026-10-03 13:36:43 +08:00
committed by GitHub
parent 65c0c346fd
commit 181a9591bf
3 changed files with 31 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 497 497" width="1em" xmlns="http://www.w3.org/2000/svg"><title>oMLX</title><!-- oMLX's menubar glyph, github.com/jundot/omlx (Apache-2.0): apps/omlx-mac/Resources/Assets.xcassets/MenubarFilled.imageset/menubar-filled.svg --><g transform="translate(0 497) scale(0.1 -0.1)" stroke="none"><path d="M2250 4483 c-99 -12 -288 -56 -381 -88 -225 -78 -410 -192 -591 -364 -131 -125 -215 -238 -292 -396 -133 -270 -175 -466 -211 -980 -32 -460 -133 -999 -267 -1430 -104 -333 -318 -823 -479 -1097 -19 -32 -29 -63 -29 -88 l0 -40 649 0 649 0 83 73 c234 205 408 493 482 797 47 194 59 305 55 540 -3 193 -1 219 15 243 40 61 102 77 167 45 68 -35 96 -99 111 -253 29 -312 -52 -727 -201 -1028 -54 -109 -152 -260 -229 -352 l-50 -60 1401 -3 c771 -1 1404 0 1407 4 12 11 18 244 10 384 -26 473 -154 873 -529 1650 -65 135 -128 274 -140 310 -31 91 -39 270 -15 360 61 234 231 401 647 634 182 102 214 141 167 200 -29 36 -40 40 -281 92 -391 84 -459 117 -673 324 -82 80 -181 168 -220 197 -201 148 -438 254 -681 304 -78 16 -144 21 -319 24 -121 2 -236 1 -255 -2z m951 -841 c142 -74 162 -269 39 -374 -94 -81 -226 -71 -317 24 -42 43 -63 96 -63 155 1 171 185 276 341 195z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+27
View File
@@ -0,0 +1,27 @@
package provider
import "testing"
// oMLX (omlx.ai, github.com/jundot/omlx) is a local server on :8000 that
// speaks all three APIs. A fresh install binds loopback and asks no key, so
// it's a NoKey local preset; its Anthropic base is the root, /v1/messages is
// magpie's path there, as it is for Ollama.
func TestOmlxPreset(t *testing.T) {
pr := Preset("omlx")
if pr == nil {
t.Fatal("no omlx preset")
}
if pr.Kind != KindLocal || !pr.NoKey || pr.KeysURL != "" {
t.Fatalf("kind/noKey/keysURL: %q %v %q", pr.Kind, pr.NoKey, pr.KeysURL)
}
if pr.Chat != "http://localhost:8000/v1" || pr.Responses != "http://localhost:8000/v1" || pr.Anthropic != "http://localhost:8000" {
t.Fatalf("endpoints: %q %q %q", pr.Chat, pr.Responses, pr.Anthropic)
}
p, err := FromPreset("omlx")
if err != nil {
t.Fatal(err)
}
if p.ID != "omlx" || p.Preset != "omlx" || p.Icon != "omlx" {
t.Fatalf("from preset: %+v", p)
}
}
+3
View File
@@ -417,6 +417,9 @@ var presets = []PresetDef{
{ID: "lmstudio", Name: "LM Studio", Icon: "lmstudio", Kind: KindLocal, NoKey: true,
Chat: "http://localhost:1234/v1",
Note: "local server on :1234", Website: "https://lmstudio.ai"},
{ID: "omlx", Name: "oMLX", Icon: "omlx", Kind: KindLocal, NoKey: true,
Chat: "http://localhost:8000/v1", Responses: "http://localhost:8000/v1", Anthropic: "http://localhost:8000",
Note: "local server on :8000", Website: "https://omlx.ai"},
}
func bedrockChat(region string) string {