Image-Text-to-Text
Transformers
Safetensors
English
Turkish
qwen3_5
loopl
on-device
agent
tool-calling
qwen3.5
sft
vision
conversational
Instructions to use cagataydev/loopl-2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cagataydev/loopl-2b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cagataydev/loopl-2b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("cagataydev/loopl-2b") model = AutoModelForMultimodalLM.from_pretrained("cagataydev/loopl-2b", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cagataydev/loopl-2b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cagataydev/loopl-2b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cagataydev/loopl-2b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/cagataydev/loopl-2b
- SGLang
How to use cagataydev/loopl-2b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cagataydev/loopl-2b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cagataydev/loopl-2b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cagataydev/loopl-2b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cagataydev/loopl-2b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use cagataydev/loopl-2b with Docker Model Runner:
docker model run hf.co/cagataydev/loopl-2b
card: loopl 2B v1.1 (bf16) — train/cards.py
Browse files
README.md
CHANGED
|
@@ -20,24 +20,35 @@ tags:
|
|
| 20 |
- vision
|
| 21 |
- image-text-to-text
|
| 22 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# loopl 2B · v1.1
|
| 24 |
|
| 25 |
-
**
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
**
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
-
##
|
| 41 |
|
| 42 |
| probe | this model | previous (v1) | base Qwen3.5 4-bit |
|
| 43 |
|---|---:|---:|---:|
|
|
@@ -50,6 +61,8 @@ Qwen3.5 does.
|
|
| 50 |
|
| 51 |
Scored by `train/eval.py` on the 4-bit MLX export (greedy). The quiz asks for exact file-level facts about an agent SDK's source — hard for every small model; the delta over base is the point. Tool probes count a well-formed call with the right arguments. `identity_nosys` is the one that matters in the app: the system prompt there is the user's to edit.
|
| 52 |
|
|
|
|
|
|
|
| 53 |
## Use it today
|
| 54 |
|
| 55 |
**In the loopl app (iPhone).** Install from [TestFlight](https://testflight.apple.com/join/uUNjfzW9) → Models → the **loopl models** section lists this
|
|
@@ -67,18 +80,31 @@ python -m mlx_vlm.generate --model cagataydev/loopl-2b-4bit \
|
|
| 67 |
**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
|
| 68 |
llama.cpp's `convert_hf_to_gguf.py --no-mtp` (text only — the converter has no vision path).
|
| 69 |
|
| 70 |
-
**From Swift with the loopl SDK**
|
|
|
|
|
|
|
| 71 |
|
| 72 |
```swift
|
| 73 |
import Loopl
|
| 74 |
import LooplRuntimes
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
}
|
| 83 |
```
|
| 84 |
|
|
@@ -124,3 +150,24 @@ addresses — see the dataset card. No user conversations from the app are in th
|
|
| 124 |
## License
|
| 125 |
|
| 126 |
Apache-2.0, inherited from the Qwen3.5 base. The fine-tune, exports and dataset are © Cagatay Cali, same license.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
- vision
|
| 21 |
- image-text-to-text
|
| 22 |
---
|
| 23 |
+
<p align="center">
|
| 24 |
+
<a href="https://loopl.dev"><img src="https://huggingface.co/cagataydev/loopl-2b/resolve/main/assets/banner.png" alt="loopl — Agents that run on your phone." width="100%"></a>
|
| 25 |
+
</p>
|
| 26 |
+
|
| 27 |
+
<div align="center" style="display:flex;flex-wrap:wrap;gap:6px;justify-content:center"><a href="https://huggingface.co/cagataydev/loopl-2b/blob/main/README.md#license"><img alt="license: Apache 2.0" src="https://img.shields.io/badge/license-Apache%202.0-5d5d63?style=flat-square&labelColor=0b0b0c"></a> <img alt="bf16: transformers · 4.43 GB" src="https://img.shields.io/badge/bf16-transformers%20%C2%B7%204.43%20GB-5d5d63?style=flat-square&labelColor=0b0b0c"> <img alt="vision: ✓ 297 tensors kept" src="https://img.shields.io/badge/vision-%E2%9C%93%20297%20tensors%20kept-5d5d63?style=flat-square&labelColor=0b0b0c"> <img alt="tool calling: native + loopl JSON" src="https://img.shields.io/badge/tool%20calling-native%20%2B%20loopl%20JSON-5d5d63?style=flat-square&labelColor=0b0b0c"> <img alt="params: 2B" src="https://img.shields.io/badge/params-2B-5d5d63?style=flat-square&labelColor=0b0b0c"> <img alt="version: v1.1" src="https://img.shields.io/badge/version-v1.1-5d5d63?style=flat-square&labelColor=0b0b0c"> <a href="https://testflight.apple.com/join/uUNjfzW9"><img alt="Get it on: TestFlight" src="https://img.shields.io/badge/Get%20it%20on-TestFlight-ff5a1f?style=flat-square&labelColor=0b0b0c&logo=apple&logoColor=white"></a> <a href="https://loopl.dev"><img alt="site: loopl.dev" src="https://img.shields.io/badge/site-loopl.dev-c2410c?style=flat-square&labelColor=0b0b0c"></a> <a href="https://huggingface.co/collections/cagataydev/loopl-on-device-agents-swift-6ac51395b13a9c41d4932eaf"><img alt="collection: 6 models" src="https://img.shields.io/badge/collection-6%20models-c2410c?style=flat-square&labelColor=0b0b0c"></a></div>
|
| 28 |
+
|
| 29 |
# loopl 2B · v1.1
|
| 30 |
|
| 31 |
+
**An agent that lives on your phone.** loopl runs the model, the loop and the tools on the device. It talks, uses the
|
| 32 |
+
phone, asks before it acts — and works with the network off. This repo is the merged bf16 weights — **the base for *Train your own*** — of the
|
| 33 |
+
2B loopl model, a Qwen3.5 post-tuned to run loopl's agent loop well, know who it is, and read images.
|
| 34 |
+
|
| 35 |
+
<table align="center"><tr><td align="center" width="33%"><img src="https://huggingface.co/cagataydev/loopl-2b/resolve/main/assets/see-tool.png" alt="It uses the phone — every tool call is a row." width="250"></td><td align="center" width="33%"><img src="https://huggingface.co/cagataydev/loopl-2b/resolve/main/assets/see-approval.png" alt="It asks before anything leaves the device." width="250"></td><td align="center" width="33%"><img src="https://huggingface.co/cagataydev/loopl-2b/resolve/main/assets/see-vision.png" alt="Show it a photo. It reads it on-device." width="250"></td></tr><tr><td align="center"><sub>It uses the phone — every tool call is a row.</sub></td><td align="center"><sub>It asks before anything leaves the device.</sub></td><td align="center"><sub>Show it a photo. It reads it on-device.</sub></td></tr></table>
|
| 36 |
+
<p align="center"><sub>Real captures from the free iPhone app.</sub></p>
|
| 37 |
+
|
| 38 |
+
## What loopl is
|
| 39 |
|
| 40 |
+
- **A Swift SDK** — `Agent(model:tools:)` and a small, honest loop: model → tools → model until it answers. Tool errors go
|
| 41 |
+
back to the model (it fixes the call instead of repeating it); anything that leaves the device waits for a tap.
|
| 42 |
+
Runtimes for MLX, llama.cpp and Apple's on-device model; hooks, checkpoints, structured output, tracing.
|
| 43 |
+
- **A free iPhone app** built on it — pick a model, talk to it in airplane mode, let it use the phone (torch, haptics,
|
| 44 |
+
translation, speech, image generation, other apps, memory, HTTP), show it photos, record a take, and **train it on your
|
| 45 |
+
own conversations** from the phone. No account, nothing collected.
|
| 46 |
+
- **These models** — the same Qwen3.5 the app offers, post-tuned so the loop, the identity and the tool manners are in the
|
| 47 |
+
weights, not in a system prompt you cannot see.
|
| 48 |
|
| 49 |
+
[loopl.dev](https://loopl.dev) · [Get it on TestFlight](https://testflight.apple.com/join/uUNjfzW9) · [github.com/cagataycali/loopl](https://github.com/cagataycali/loopl)
|
| 50 |
|
| 51 |
+
## This model
|
| 52 |
|
| 53 |
| probe | this model | previous (v1) | base Qwen3.5 4-bit |
|
| 54 |
|---|---:|---:|---:|
|
|
|
|
| 61 |
|
| 62 |
Scored by `train/eval.py` on the 4-bit MLX export (greedy). The quiz asks for exact file-level facts about an agent SDK's source — hard for every small model; the delta over base is the point. Tool probes count a well-formed call with the right arguments. `identity_nosys` is the one that matters in the app: the system prompt there is the user's to edit.
|
| 63 |
|
| 64 |
+
Vision: the base's tower is frozen and **kept** — 297 `vision_tower.*` tensors in the MLX export, so the app shows the photo button.
|
| 65 |
+
|
| 66 |
## Use it today
|
| 67 |
|
| 68 |
**In the loopl app (iPhone).** Install from [TestFlight](https://testflight.apple.com/join/uUNjfzW9) → Models → the **loopl models** section lists this
|
|
|
|
| 80 |
**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
|
| 81 |
llama.cpp's `convert_hf_to_gguf.py --no-mtp` (text only — the converter has no vision path).
|
| 82 |
|
| 83 |
+
**From Swift with the loopl SDK** — the snippet below is `docs/start.md` § "Run the loop" in [the loopl repo](https://github.com/cagataycali/loopl),
|
| 84 |
+
compile-checked in CI against the package (products `Loopl` + `LooplRuntimes`); `spec` is this repo's `ModelSpec` and `dir` the
|
| 85 |
+
downloaded folder:
|
| 86 |
|
| 87 |
```swift
|
| 88 |
import Loopl
|
| 89 |
import LooplRuntimes
|
| 90 |
+
import Foundation
|
| 91 |
+
|
| 92 |
+
func chat(_ spec: ModelSpec, at dir: URL) async throws {
|
| 93 |
+
let model = MLXModel() // Metal — a real device
|
| 94 |
+
try await model.load(spec, from: dir) { _ in }
|
| 95 |
+
|
| 96 |
+
let agent = Agent(model: model,
|
| 97 |
+
tools: [CurrentTimeTool(), CalculatorTool()],
|
| 98 |
+
systemPrompt: "You are a concise assistant on the user's phone.")
|
| 99 |
+
|
| 100 |
+
for try await event in agent.stream("What time is it in Istanbul, and what is 23 × 47?") {
|
| 101 |
+
switch event {
|
| 102 |
+
case .text(let t): print(t, terminator: "")
|
| 103 |
+
case .toolStarted(let use): print("\n→ \(use.name)")
|
| 104 |
+
case .toolResult(let r): print("← \(r.content)")
|
| 105 |
+
default: break
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
}
|
| 109 |
```
|
| 110 |
|
|
|
|
| 150 |
## License
|
| 151 |
|
| 152 |
Apache-2.0, inherited from the Qwen3.5 base. The fine-tune, exports and dataset are © Cagatay Cali, same license.
|
| 153 |
+
|
| 154 |
+
## The family
|
| 155 |
+
|
| 156 |
+
Six public repos, one recipe. The app lists the three MLX rows under **Models › loopl models** (2B is the sweet spot for speed on an
|
| 157 |
+
iPhone 15/16; 4B is the most knowledgeable; 0.8B fits anywhere). Every bf16 repo is a valid `--base` for the next round.
|
| 158 |
+
|
| 159 |
+
| | MLX 4-bit · vision · what the app downloads | bf16 · the base to keep training |
|
| 160 |
+
|---|---|---|
|
| 161 |
+
| **0.8B** | [`cagataydev/loopl-0.8b-4bit`](https://huggingface.co/cagataydev/loopl-0.8b-4bit) · 625 MB | [`cagataydev/loopl-0.8b`](https://huggingface.co/cagataydev/loopl-0.8b) · 1.71 GB |
|
| 162 |
+
| **2B** | [`cagataydev/loopl-2b-4bit`](https://huggingface.co/cagataydev/loopl-2b-4bit) · 1.72 GB | [`cagataydev/loopl-2b`](https://huggingface.co/cagataydev/loopl-2b) · 4.43 GB ← this repo |
|
| 163 |
+
| **4B** | [`cagataydev/loopl-4b-4bit`](https://huggingface.co/cagataydev/loopl-4b-4bit) · 3.03 GB | [`cagataydev/loopl-4b`](https://huggingface.co/cagataydev/loopl-4b) · 9.08 GB |
|
| 164 |
+
|
| 165 |
+
All of them: [the loopl collection](https://huggingface.co/collections/cagataydev/loopl-on-device-agents-swift-6ac51395b13a9c41d4932eaf).
|
| 166 |
+
|
| 167 |
+
## Links
|
| 168 |
+
|
| 169 |
+
- Site and docs — [loopl.dev](https://loopl.dev) · SDK: [agent loop](https://loopl.dev/sdk/agent/), [tools](https://loopl.dev/sdk/tools/), [human in the loop](https://loopl.dev/sdk/hitl/), [models](https://loopl.dev/models/)
|
| 170 |
+
- App — [Get it on TestFlight](https://testflight.apple.com/join/uUNjfzW9) (iOS 18+, free, public beta)
|
| 171 |
+
- Code — [github.com/cagataycali/loopl](https://github.com/cagataycali/loopl) · [issues](https://github.com/cagataycali/loopl/issues) · training: [github.com/cagataycali/loopl-train](https://github.com/cagataycali/loopl-train)
|
| 172 |
+
- Models — [the loopl collection](https://huggingface.co/collections/cagataydev/loopl-on-device-agents-swift-6ac51395b13a9c41d4932eaf) · data: [cagataydev/loopl-train](https://huggingface.co/datasets/cagataydev/loopl-train) *(private)*
|
| 173 |
+
- Built by Cagatay Cali — [@cagataycali](https://github.com/cagataycali)
|