Views
No views yet
1import mlx_lm
2from huggingface_hub import snapshot_download
3
4# Download adapter from HF Hub to local cache
5adapter_path = snapshot_download("v9ai/outreach-email-qwen3-1.7b-4bit-lora")
6
7# Load base model with adapter
8model, tokenizer = mlx_lm.load("mlx-community/Qwen3-1.7B-4bit", adapter_path=adapter_path)
9
10# Generate
11messages = [
12 {"role": "system", "content": "You write B2B outreach emails..."},
13 {"role": "user", "content": "Write an initial outreach email..."},
14]
15prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
16output = mlx_lm.generate(model, tokenizer, prompt=prompt, max_tokens=512)1# Download adapter first, then serve via mlx_lm.server (OpenAI-compatible API)
2python3 -c "from huggingface_hub import snapshot_download; print(snapshot_download('v9ai/outreach-email-qwen3-1.7b-4bit-lora'))"
3# Use the printed path as --adapter-path:
4python3 -m mlx_lm.server \
5 --model mlx-community/Qwen3-1.7B-4bit \
6 --adapter-path /path/to/cached/adapter \
7 --port 8080| Parameter | Value |
|---|---|
| Base model | mlx-community/Qwen3-1.7B-4bit |
| Fine-tune type | LoRA |
| Rank | 8 |
| Scale | 4.0 |
| Dropout | 0.1 |
| Max sequence length | 512 |
| Training iterations | 1170 |
| Learning rate | 1e-05 |
| Hardware | Apple M1 MacBook Pro, 16GB |
{"subject": "...", "body": "..."}