Text Generation
MLX
Safetensors
English
gpt_oss
mixture-of-experts
4bit
quantized
apple-silicon
conversational
agentic
retrieval
search
tool-calling
lm-studio
4-bit precision
Instructions to use mlx-community/context-1-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/context-1-MLX-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/context-1-MLX-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- Pi new
How to use mlx-community/context-1-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/context-1-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mlx-community/context-1-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mlx-community/context-1-MLX-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/context-1-MLX-4bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mlx-community/context-1-MLX-4bit
Run Hermes
hermes
- MLX LM
How to use mlx-community/context-1-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/context-1-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/context-1-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/context-1-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -13,9 +13,11 @@ tags:
|
|
| 13 |
- quantized
|
| 14 |
- apple-silicon
|
| 15 |
- text-generation
|
|
|
|
| 16 |
- agentic
|
| 17 |
- retrieval
|
| 18 |
- search
|
|
|
|
| 19 |
- lm-studio
|
| 20 |
---
|
| 21 |
|
|
@@ -23,6 +25,9 @@ tags:
|
|
| 23 |
|
| 24 |
MLX quantization of [chromadb/context-1](https://huggingface.co/chromadb/context-1) for Apple Silicon.
|
| 25 |
|
|
|
|
|
|
|
|
|
|
| 26 |
## Key Specs
|
| 27 |
|
| 28 |
| Detail | Value |
|
|
@@ -35,6 +40,9 @@ MLX quantization of [chromadb/context-1](https://huggingface.co/chromadb/context
|
|
| 35 |
| Attention | Alternating sliding window (128 tokens) + full attention |
|
| 36 |
| Quantization | 4-bit affine, group size 64 |
|
| 37 |
| Original Precision | BF16 |
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## What is Context-1?
|
| 40 |
|
|
@@ -48,9 +56,17 @@ Key capabilities:
|
|
| 48 |
|
| 49 |
Performance: comparable to frontier LLMs at a fraction of the cost, up to **10x faster inference**.
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
## Requirements
|
| 52 |
|
| 53 |
-
- Apple Silicon Mac with
|
| 54 |
- `mlx-lm >= 0.31.2`
|
| 55 |
|
| 56 |
```bash
|
|
@@ -80,7 +96,7 @@ print(response)
|
|
| 80 |
|
| 81 |
### LM Studio
|
| 82 |
|
| 83 |
-
This model is compatible with [LM Studio](https://lmstudio.ai) on Apple Silicon. Search for `context-1-MLX-4bit` in the model browser.
|
| 84 |
|
| 85 |
## Important: Agent Harness
|
| 86 |
|
|
|
|
| 13 |
- quantized
|
| 14 |
- apple-silicon
|
| 15 |
- text-generation
|
| 16 |
+
- conversational
|
| 17 |
- agentic
|
| 18 |
- retrieval
|
| 19 |
- search
|
| 20 |
+
- tool-calling
|
| 21 |
- lm-studio
|
| 22 |
---
|
| 23 |
|
|
|
|
| 25 |
|
| 26 |
MLX quantization of [chromadb/context-1](https://huggingface.co/chromadb/context-1) for Apple Silicon.
|
| 27 |
|
| 28 |
+
- Converted with [mlx-lm](https://github.com/ml-explore/mlx-lm) version 0.31.2
|
| 29 |
+
- Also available: [context-1-MLX-6bit](https://huggingface.co/mlx-community/context-1-MLX-6bit)
|
| 30 |
+
|
| 31 |
## Key Specs
|
| 32 |
|
| 33 |
| Detail | Value |
|
|
|
|
| 40 |
| Attention | Alternating sliding window (128 tokens) + full attention |
|
| 41 |
| Quantization | 4-bit affine, group size 64 |
|
| 42 |
| Original Precision | BF16 |
|
| 43 |
+
| Disk Size | ~11 GB |
|
| 44 |
+
| Peak Memory | ~12 GB |
|
| 45 |
+
| Chat Template | Supported |
|
| 46 |
|
| 47 |
## What is Context-1?
|
| 48 |
|
|
|
|
| 56 |
|
| 57 |
Performance: comparable to frontier LLMs at a fraction of the cost, up to **10x faster inference**.
|
| 58 |
|
| 59 |
+
## Performance on Apple Silicon
|
| 60 |
+
|
| 61 |
+
| Metric | Value |
|
| 62 |
+
|---|---|
|
| 63 |
+
| Prompt Processing | 227 tokens/sec |
|
| 64 |
+
| Generation | 172 tokens/sec |
|
| 65 |
+
| Peak Memory | 12 GB |
|
| 66 |
+
|
| 67 |
## Requirements
|
| 68 |
|
| 69 |
+
- Apple Silicon Mac with 16GB+ unified memory
|
| 70 |
- `mlx-lm >= 0.31.2`
|
| 71 |
|
| 72 |
```bash
|
|
|
|
| 96 |
|
| 97 |
### LM Studio
|
| 98 |
|
| 99 |
+
This model is compatible with [LM Studio](https://lmstudio.ai) on Apple Silicon. Search for `context-1-MLX-4bit` in the model browser and download directly.
|
| 100 |
|
| 101 |
## Important: Agent Harness
|
| 102 |
|