feat: add mlx-server runtime to the metal-agent#471
Merged
Defilan merged 1 commit intoMay 17, 2026
Conversation
Add mlx-server as a metal-agent inference runtime alongside llama-server, omlx, ollama, and vllm-swift. mlx-server (github.com/Defilan/mlx-server) is a native OpenAI-compatible MLX inference server; this lets the agent supervise it as a first-class InferenceService runtime. - MLXServerExecutor (executor_mlx_server.go) implements ProcessExecutor: resolves the model directory, spawns mlx-server, polls /health, and stops it with SIGTERM plus a grace period. Unlike the vllm-swift executor's per-spawn ephemeral port it binds a fixed port (default 8080) so clients keep a stable base URL across respawns. - runtimeMLXServer wired into the executor-selection switch and into validateRuntimeFormat (MLX directories and HF safetensors accepted, gguf rejected — same as vllm-swift). - --mlx-server-bin, --mlx-server-port, and --mlx-server-startup-timeout flags on the metal-agent, with binary auto-detection. - mlx-server-specific flags such as --tool-call-format and --reasoning ride through InferenceService.spec.extraArgs; no new CRD fields. Unit tests cover argument construction, the fixed-port executor, health polling, and process teardown. Signed-off-by: Christopher Maher <chris@mahercode.io>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
mlx-serveras a metal-agent inference runtime, alongsidellama-server,omlx,ollama, andvllm-swift.Why
mlx-server is a native
OpenAI-compatible MLX inference server for Apple Silicon. This lets the
metal-agent supervise it as a first-class
InferenceServiceruntime — thesame lifecycle the agent already gives the other runtimes.
No linked issue.
How
MLXServerExecutor(pkg/agent/executor_mlx_server.go) implementsProcessExecutor: resolves the model directory, spawnsmlx-server, polls/health, and stops it with SIGTERM plus a grace period. Unlike thevllm-swift executor's per-spawn ephemeral port it binds a fixed port
(default 8080) so clients keep a stable base URL across respawns.
runtimeMLXServerwired into the executor-selection switch andvalidateRuntimeFormat(MLX directories and HF safetensors accepted,ggufrejected — same as vllm-swift).
--mlx-server-bin,--mlx-server-port, and--mlx-server-startup-timeoutflags on the metal-agent, with binary auto-detection.
mlx-server-specific flags such as--tool-call-formatand--reasoningride through
InferenceService.spec.extraArgs— no new CRD fields.Checklist
executor_mlx_server_test.gocovers arg construction, the fixed-port executor, health polling, and process teardownmake testpasses locallymake lintpasses locallygit commit -s) per DCO