MLX
Apple’s array framework. On an M-series Mac it is the fastest way to run a model locally.
mlx-lm is Apple’s array framework pointed at language models. On an M-series Mac it is the fastest local path, because it uses unified memory instead of fighting for a discrete GPU.
Apple Silicon only. `mlx_lm.server --model mlx-community/Qwen3-8B-4bit` serves OpenAI-compat on localhost:8080/v1. Context is whatever your unified memory holds.
- Max context
- Whatever your unified memory allows
- Free tier
- Unlimited and private
- Requirement
- Nothing — no account
Endpoint
Base URL
http://localhost:8080/v1Rate limit
None — it is your machine- OpenAI-compatible
- Native SDK: mlx-lm
- text
- vision
Code examples
npm install openaiimport OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'http://localhost:8080/v1',
apiKey: 'not-needed'
})
const response = await client.chat.completions.create({
model: 'mlx-community/Qwen3-8B-4bit',
messages: [{ role: 'user', content: 'Explain closures in one paragraph.' }]
})
console.log(response.choices[0].message.content)pip install openaifrom openai import OpenAI
client = OpenAI(
base_url="http://localhost:8080/v1",
api_key="not-needed",
)
response = client.chat.completions.create(
model="mlx-community/Qwen3-8B-4bit",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response.choices[0].message.content)curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "mlx-community/Qwen3-8B-4bit",
"messages": [{"role": "user", "content": "Explain closures in one paragraph."}]
}'pip install mlx-lmfrom mlx_lm import load, generate
model, tokenizer = load("mlx-community/Qwen3-8B-4bit")
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "Explain closures in one paragraph."}],
add_generation_prompt=True,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512))Worth knowing
- Apple Silicon only.
- Start the server first: `mlx_lm.server --model mlx-community/Qwen3-8B-4bit`.
Models you get for free3
- Qwen 3
qwen3 - Qwen Coder
Qwen2.5-Coder-7B - GPT-OSS 120B
gpt-oss-120b