mlx_lm.server listens on http://127.0.0.1:8080/v1 — it isn’t reachable from another machine unless you bind it wider or forward the port. MLX-LM Server has no built-in authentication: anything that can reach port 8080 can call the API with no credential. Keep MLX-LM Server on localhost and run the Tokios connector next to it instead: the connector dials out to https://api.tokios.com, and your tools, teammates, or agents call one authenticated endpoint from anywhere.
mlx-lm Python package from Apple’s ml-explore team. This guide covers the current release.What is Apple Silicon native inference
MLX-LM Server is different from the other backends Tokios supports: it runs only on Apple Silicon Macs (M1 and later) and takes direct advantage of the unified-memory architecture that all Apple Silicon chips share.MLX-LM Server’s auth is off by default
mlx_lm.server starts an OpenAI-compatible HTTP server on port 8080. Run it and it accepts requests from anyone who can reach the port — no credential required:
--host 0.0.0.0, port forwarding, or a tunnel — gives unauthenticated API access to anyone who can reach it.
The outbound-only way
Install MLX-LM and start the server locally
http://127.0.0.1:8080. Leave it on the default 127.0.0.1 — don’t pass --host 0.0.0.0.Pair the Tokios connector
TKS-XXXX-XXXX, valid for about 15 minutes.On the Mac running MLX-LM Server, run the macOS install one-liner:tokios-connector installed? Pass the code directly instead:Point the connector at MLX-LM Server's /v1 API
http://127.0.0.1:8080/v1 as the upstream automatically. If you’re serving multiple models through a tokios-connector.json config, set the upstream BaseUrl explicitly:Register a deployment
mlx-qwen-tunnel. That public name, not the HuggingFace model id, is what clients send in the model field.Create an API key
* for all). Copy the sk-tok-... key now — it’s shown only once.Use it from anywhere
Once you have a deployment name and an API key, any OpenAI- or Anthropic-compatible client can reach your MLX-LM model — from another machine, a teammate’s laptop, or a hosted agent.Server configuration reference
MLX-LM Server exposes several flags for tuning inference. The most useful ones:FAQ
What are the prerequisites for MLX-LM Server?
What are the prerequisites for MLX-LM Server?
pip or conda. Install with pip install mlx-lm. The MLX framework uses Metal for GPU acceleration and unified memory for model weights — no separate GPU drivers or CUDA toolkit needed.How do I install MLX-LM Server?
How do I install MLX-LM Server?
pip install mlx-lm (or conda install -c conda-forge mlx-lm). Then start the server with mlx_lm.server --model <model-id>. The model is downloaded from HuggingFace on first use. Models from the mlx-community organization are pre-converted to MLX format and ready to use.What port does MLX-LM Server use?
What port does MLX-LM Server use?
127.0.0.1 (localhost only). Change the port with --port and the bind address with --host. For Tokios, keep the defaults — the connector reaches the server on http://127.0.0.1:8080/v1.Does MLX-LM Server support streaming?
Does MLX-LM Server support streaming?
"stream": true in the request body and the server returns standard server-sent events (SSE). Through Tokios, streaming works end-to-end — set "stream": true and Tokios returns SSE in OpenAI or Anthropic format, depending on which API surface you called.Does MLX-LM Server support tool calling?
Does MLX-LM Server support tool calling?
tools field of the request.Can I use LoRA adapters with MLX-LM Server?
Can I use LoRA adapters with MLX-LM Server?
--adapter-path pointing to a directory with LoRA adapter weights. Fine-tune adapters with mlx_lm.lora (included in the same package) and then serve the base model with the adapter overlaid. Register the adapter as its own Tokios deployment with its own public name.How does MLX-LM Server compare to llama.cpp on Apple Silicon?
How does MLX-LM Server compare to llama.cpp on Apple Silicon?
Can I serve more than one model?
Can I serve more than one model?
mlx_lm.server processes on different ports, or register additional deployments in the Models tab. Use a tokios-connector.json config file to define multiple upstreams and routes for a single connector. See Connector config for the full multi-model file format.What models work with MLX-LM Server?
What models work with MLX-LM Server?
mlx_lm.convert.Your model never leaves your machine — your endpoint works everywhere
MLX-LM Server keeps doing exactly what it does today, on localhost, with no inbound ports and no exposed API. The connector only dials out. Everything past that — auth, routing, streaming — is one endpoint you can call from any machine, teammate, or agent you choose to give a key to.Quickstart
API keys
sk-tok-... keys for teammates and agents.Mac Studio setup
Sources
- ml-explore/mlx-lm — official repository for the MLX-LM Python package and server
- MLX-LM Server documentation (SERVER.md) — server API reference and supported endpoints
- MLX framework — the underlying array framework for Apple Silicon
- mlx-framework.org — MLX framework overview and ecosystem links
- mlx-community on HuggingFace — pre-converted MLX models ready for serving
- Exploring LLMs with MLX and the Neural Accelerators in M5 — Apple Machine Learning Research on M5 ANE performance
- Run local agentic AI on the Mac using MLX (WWDC26) — Apple session on MLX-LM Server, continuous batching, and distributed inference