Views
No views yet
| Metric | Base Model | Trained Model |
|---|---|---|
| Strands Knowledge | 0/10 (hallucinates) | 10/10 (accurate) |
| Tool Calling | Works | ✅ 100% preserved |
| Training Time | - | 14 minutes |
| Adapter Size | - | 19MB |
pip install strands-agents strands-mlx1from strands import Agent
2from strands_mlx import MLXModel
3
4# Load base model + this adapter
5model = MLXModel(
6 model_id="mlx-community/Qwen3-1.7B-4bit",
7 adapter_path="cagataycali/qwen3-strands-adapter" # Your HF repo
8)
9
10agent = Agent(model=model)
11
12# Now it knows Strands!
13agent("How do I create a Strands tool?")
14# → Accurate answer with working code examples
15
16agent("What model providers does Strands support?")
17# → Complete list: Bedrock, Anthropic, OpenAI, Ollama, MLX, etc.mask_prompt=True - Only train on assistant completions1from strands import Agent
2from strands_mlx import MLXModel
3
4model = MLXModel(
5 model_id="mlx-community/Qwen3-1.7B-4bit",
6 adapter_path="cagataycali/qwen3-strands-adapter"
7)
8
9# Tool calling still works perfectly!
10agent = Agent(
11 model=model,
12 tools=["calculator", "shell", "file_read"]
13)
14
15agent("Calculate 15 * 7 and explain Strands")
16# → Uses calculator AND provides Strands knowledge1# Load different adapters for different domains
2strands_model = MLXModel(
3 "mlx-community/Qwen3-1.7B-4bit",
4 adapter_path="cagataycali/qwen3-strands-adapter"
5)
6
7coding_model = MLXModel(
8 "mlx-community/Qwen3-1.7B-4bit",
9 adapter_path="your-coding-adapter"
10)1from strands import Agent
2from strands_mlx import MLXModel, MLXSessionManager
3from strands_mlx.tools import mlx_trainer, dataset_splitter
4
5# 1. Collect training data
6session = MLXSessionManager(session_id="my_domain")
7model = MLXModel("mlx-community/Qwen3-1.7B-4bit")
8agent = Agent(model=model, session_manager=session)
9
10# Have conversations (100-200 examples recommended)
11agent("Teach me about X")
12# Data auto-saved to ~/.strands/mlx_training_data/my_domain.jsonl
13
14# 2. Split dataset
15dataset_splitter(
16 input_path="~/.strands/mlx_training_data/my_domain.jsonl",
17 train_ratio=0.8,
18 valid_ratio=0.1,
19 test_ratio=0.1
20)
21
22# 3. Train
23mlx_trainer(
24 action="train",
25 config={
26 "model": "mlx-community/Qwen3-1.7B-4bit",
27 "data": "~/.strands/mlx_training_data/my_domain",
28 "iters": 200,
29 "learning_rate": 1e-5,
30 "batch_size": 1,
31 "grad_checkpoint": True
32 }
33)
34
35# 4. Use it!
36trained = MLXModel("mlx-community/Qwen3-1.7B-4bit", adapter_path="./adapter")I'll help you create a strands agent. Let me use the system_monitor tool...
<tool_call>{"name": "system_monitor", ...}</tool_call> ← Hallucinated toolfrom strands import Agent
agent = Agent(
system_prompt="You are a helpful assistant",
tools=["calculator", "shell", "file_read"]
)
agent("Calculate 2+2")adapters.safetensors - Trained LoRA weightsadapter_config.json - LoRA configuration0000100_adapters.safetensors - Checkpoint at iter 1000000200_adapters.safetensors - Checkpoint at iter 200pip install strands-agents>=0.2.0 strands-mlx>=0.2.1