Image-Text-to-Text
MLX
Safetensors
English
Turkish
qwen3_5
loopl
on-device
agent
tool-calling
qwen3.5
sft
vision
4-bit precision
conversational
Instructions to use cagataydev/loopl-2b-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use cagataydev/loopl-2b-4bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("cagataydev/loopl-2b-4bit") config = load_config("cagataydev/loopl-2b-4bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use cagataydev/loopl-2b-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 "cagataydev/loopl-2b-4bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "cagataydev/loopl-2b-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use cagataydev/loopl-2b-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 "cagataydev/loopl-2b-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 cagataydev/loopl-2b-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use cagataydev/loopl-2b-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "cagataydev/loopl-2b-4bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "cagataydev/loopl-2b-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
card: loopl 2B v1.1 (mlx) — train/cards.py
Browse files
README.md
CHANGED
|
@@ -21,7 +21,6 @@ tags:
|
|
| 21 |
- vision
|
| 22 |
- image-text-to-text
|
| 23 |
- 4-bit
|
| 24 |
-
- v1.1
|
| 25 |
---
|
| 26 |
# loopl 2B · v1.1
|
| 27 |
|
|
@@ -29,18 +28,16 @@ tags:
|
|
| 29 |
(model → tools → model until it answers; errors go back to the model, approvals pause the loop) and the iPhone's own
|
| 30 |
abilities as tools — vision, voice, transcription, translation, torch, haptics, deep links, memory, HTTP. Site:
|
| 31 |
[loopl.dev](https://loopl.dev) · app: [TestFlight](https://testflight.apple.com/join/uUNjfzW9) · code: [github.com/cagataycali/loopl](https://github.com/cagataycali/loopl)
|
| 32 |
-
·
|
| 33 |
|
| 34 |
**This model** is [Qwen/Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B) fully fine-tuned by Cagatay Cali
|
| 35 |
-
([@cagataycali](https://github.com/cagataycali)) on [cagataydev/loopl-train](https://huggingface.co/datasets/cagataydev/loopl-train): how an agent loop
|
| 36 |
works and how loopl's runtime behaves, tool calling in both dialects loopl speaks (the model's native template and
|
| 37 |
loopl's JSON prompt), recovering from tool errors instead of repeating the call, who it is and who built it, and honesty
|
| 38 |
about what it does not know. The **vision tower is the base's, frozen and kept** — the MLX export reads images like
|
| 39 |
Qwen3.5 does.
|
| 40 |
|
| 41 |
-
> **This repo is the MLX 4-bit export (group 64)
|
| 42 |
-
|
| 43 |
-
> ⚠️ **Staging copy of v1.1.** When a version wins every gate it is promoted onto [cagataydev/loopl-2b](https://huggingface.co/cagataydev/loopl-2b) (and its `-4bit` / `-GGUF`), which is what the app's catalog tracks. Use that one unless you are comparing versions.
|
| 44 |
|
| 45 |
## Scores
|
| 46 |
|
|
@@ -57,9 +54,9 @@ Scored by `train/eval.py` on the 4-bit MLX export (greedy). The quiz asks for ex
|
|
| 57 |
|
| 58 |
## Use it today
|
| 59 |
|
| 60 |
-
**In the loopl app (iPhone).** Install from [TestFlight](https://testflight.apple.com/join/uUNjfzW9) →
|
| 61 |
-
|
| 62 |
-
|
| 63 |
|
| 64 |
**On a Mac with MLX** (vision included):
|
| 65 |
|
|
@@ -69,11 +66,8 @@ python -m mlx_vlm.generate --model cagataydev/loopl-2b-4bit \
|
|
| 69 |
--image photo.jpg --prompt "What is in this picture? Then tell me who built you." --max-tokens 200
|
| 70 |
```
|
| 71 |
|
| 72 |
-
**With llama.cpp**
|
| 73 |
-
|
| 74 |
-
```bash
|
| 75 |
-
llama-cli -hf cagataydev/loopl-2b-GGUF:loopl-2b-Q4_K_M.gguf -p "Who built you, and what is 23 × 47?"
|
| 76 |
-
```
|
| 77 |
|
| 78 |
**From Swift with the loopl SDK** (`https://github.com/cagataycali/loopl`, products `Loopl` + `LooplRuntimes`):
|
| 79 |
|
|
@@ -81,7 +75,7 @@ llama-cli -hf cagataydev/loopl-2b-GGUF:loopl-2b-Q4_K_M.gguf -p "Who built you, a
|
|
| 81 |
import Loopl
|
| 82 |
import LooplRuntimes
|
| 83 |
|
| 84 |
-
let model = MLXModel() // or GGUFModel() for
|
| 85 |
try await model.load(spec, from: weightsDirectory) { _ in } // spec: the ModelSpec for cagataydev/loopl-2b-4bit; weights: the downloaded folder
|
| 86 |
|
| 87 |
let agent = Agent(model: model, tools: AppleTools.available)
|
|
@@ -90,7 +84,9 @@ for try await event in agent.stream("Torch on, then remember that I parked on le
|
|
| 90 |
}
|
| 91 |
```
|
| 92 |
|
| 93 |
-
The bf16 weights (
|
|
|
|
|
|
|
| 94 |
quantisation with `mlx_vlm.convert -q` (keeps vision) — `mlx_lm.convert` silently drops the tower.
|
| 95 |
|
| 96 |
## Recipe
|
|
@@ -98,7 +94,7 @@ quantisation with `mlx_vlm.convert -q` (keeps vision) — `mlx_lm.convert` silen
|
|
| 98 |
| | |
|
| 99 |
|---|---|
|
| 100 |
| base | [Qwen/Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B) (vision tower frozen, `visual.*` never trained) |
|
| 101 |
-
| data | [cagataydev/loopl-train](https://huggingface.co/datasets/cagataydev/loopl-train) @ `db6fa452` · 10596 rendered rows / 16,710,241 tokens · both tool dialects · oversample `c=2` |
|
| 102 |
| method | full fine-tune of the language model · lr 1.5e-05 · batch 2×8 · max_len 4096 · 2.0 epochs, best-epoch checkpoint kept |
|
| 103 |
| eval loss | ep1 1.874, ep2 1.935 → best 1.874 (eval split of the same dataset revision) |
|
| 104 |
| compute | a100-large (Hugging Face Jobs), 5789 s train · job `6ac4fa03404719ba3765fc09` |
|
|
|
|
| 21 |
- vision
|
| 22 |
- image-text-to-text
|
| 23 |
- 4-bit
|
|
|
|
| 24 |
---
|
| 25 |
# loopl 2B · v1.1
|
| 26 |
|
|
|
|
| 28 |
(model → tools → model until it answers; errors go back to the model, approvals pause the loop) and the iPhone's own
|
| 29 |
abilities as tools — vision, voice, transcription, translation, torch, haptics, deep links, memory, HTTP. Site:
|
| 30 |
[loopl.dev](https://loopl.dev) · app: [TestFlight](https://testflight.apple.com/join/uUNjfzW9) · code: [github.com/cagataycali/loopl](https://github.com/cagataycali/loopl)
|
| 31 |
+
· the models: [the loopl collection](https://huggingface.co/collections/cagataydev/loopl-on-device-agents-swift-6ac51395b13a9c41d4932eaf).
|
| 32 |
|
| 33 |
**This model** is [Qwen/Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B) fully fine-tuned by Cagatay Cali
|
| 34 |
+
([@cagataycali](https://github.com/cagataycali)) on [cagataydev/loopl-train](https://huggingface.co/datasets/cagataydev/loopl-train) *(private)*: how an agent loop
|
| 35 |
works and how loopl's runtime behaves, tool calling in both dialects loopl speaks (the model's native template and
|
| 36 |
loopl's JSON prompt), recovering from tool errors instead of repeating the call, who it is and who built it, and honesty
|
| 37 |
about what it does not know. The **vision tower is the base's, frozen and kept** — the MLX export reads images like
|
| 38 |
Qwen3.5 does.
|
| 39 |
|
| 40 |
+
> **This repo is the MLX 4-bit export (group 64) — the one the loopl app downloads** — 1.72 GB, 297 `vision_tower.*` tensors of 991 so it reads images, same layout as [mlx-community/Qwen3.5-2B-4bit](https://huggingface.co/mlx-community/Qwen3.5-2B-4bit). bf16 weights for continual post-tuning: [cagataydev/loopl-2b](https://huggingface.co/cagataydev/loopl-2b).
|
|
|
|
|
|
|
| 41 |
|
| 42 |
## Scores
|
| 43 |
|
|
|
|
| 54 |
|
| 55 |
## Use it today
|
| 56 |
|
| 57 |
+
**In the loopl app (iPhone).** Install from [TestFlight](https://testflight.apple.com/join/uUNjfzW9) → Models → the **loopl models** section lists this
|
| 58 |
+
size (no account, no token) → download. The app sees the vision tower and shows the photo button; the system prompt is yours to
|
| 59 |
+
edit — identity and tool manners are in the weights.
|
| 60 |
|
| 61 |
**On a Mac with MLX** (vision included):
|
| 62 |
|
|
|
|
| 66 |
--image photo.jpg --prompt "What is in this picture? Then tell me who built you." --max-tokens 200
|
| 67 |
```
|
| 68 |
|
| 69 |
+
**With llama.cpp:** the GGUF Q4_K_M export (`cagataydev/loopl-2b-GGUF`) is not public yet; export your own from the bf16 weights with
|
| 70 |
+
llama.cpp's `convert_hf_to_gguf.py --no-mtp` (text only — the converter has no vision path).
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
**From Swift with the loopl SDK** (`https://github.com/cagataycali/loopl`, products `Loopl` + `LooplRuntimes`):
|
| 73 |
|
|
|
|
| 75 |
import Loopl
|
| 76 |
import LooplRuntimes
|
| 77 |
|
| 78 |
+
let model = MLXModel() // or GGUFModel() for a GGUF export
|
| 79 |
try await model.load(spec, from: weightsDirectory) { _ in } // spec: the ModelSpec for cagataydev/loopl-2b-4bit; weights: the downloaded folder
|
| 80 |
|
| 81 |
let agent = Agent(model: model, tools: AppleTools.available)
|
|
|
|
| 84 |
}
|
| 85 |
```
|
| 86 |
|
| 87 |
+
**Keep post-tuning it.** The bf16 weights ([cagataydev/loopl-2b](https://huggingface.co/cagataydev/loopl-2b)) are the base for continual post-tuning: in the app,
|
| 88 |
+
**Models › Train your own** takes a loopl model as the base and trains on your own shared conversations (`train/loopl_sft.py
|
| 89 |
+
--base cagataydev/loopl-2b`); on a Mac they load with `transformers` ≥ 5 as `Qwen3_5ForConditionalGeneration`. Export your own
|
| 90 |
quantisation with `mlx_vlm.convert -q` (keeps vision) — `mlx_lm.convert` silently drops the tower.
|
| 91 |
|
| 92 |
## Recipe
|
|
|
|
| 94 |
| | |
|
| 95 |
|---|---|
|
| 96 |
| base | [Qwen/Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B) (vision tower frozen, `visual.*` never trained) |
|
| 97 |
+
| data | [cagataydev/loopl-train](https://huggingface.co/datasets/cagataydev/loopl-train) *(private)* @ `db6fa452` · 10596 rendered rows / 16,710,241 tokens · both tool dialects · oversample `c=2` |
|
| 98 |
| method | full fine-tune of the language model · lr 1.5e-05 · batch 2×8 · max_len 4096 · 2.0 epochs, best-epoch checkpoint kept |
|
| 99 |
| eval loss | ep1 1.874, ep2 1.935 → best 1.874 (eval split of the same dataset revision) |
|
| 100 |
| compute | a100-large (Hugging Face Jobs), 5789 s train · job `6ac4fa03404719ba3765fc09` |
|