diff --git a/internal/gui/assets/icons/omlx.svg b/internal/gui/assets/icons/omlx.svg new file mode 100644 index 000000000..8d143ebde --- /dev/null +++ b/internal/gui/assets/icons/omlx.svg @@ -0,0 +1 @@ +oMLX diff --git a/internal/provider/omlx_test.go b/internal/provider/omlx_test.go new file mode 100644 index 000000000..c837321c8 --- /dev/null +++ b/internal/provider/omlx_test.go @@ -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) + } +} diff --git a/internal/provider/presets.go b/internal/provider/presets.go index 85358233c..029adce34 100644 --- a/internal/provider/presets.go +++ b/internal/provider/presets.go @@ -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 {