Image-Text-to-Text
Transformers
Safetensors
English
Turkish
qwen3_5
tin
tin-lang
loopl
on-device
agent
tool-calling
code
qwen3.5
sft
conversational
Instructions to use cagataydev/tin-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cagataydev/tin-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cagataydev/tin-4b") 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/tin-4b") model = AutoModelForMultimodalLM.from_pretrained("cagataydev/tin-4b", 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/tin-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cagataydev/tin-4b" # 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/tin-4b", "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/tin-4b
- SGLang
How to use cagataydev/tin-4b 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/tin-4b" \ --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/tin-4b", "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/tin-4b" \ --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/tin-4b", "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/tin-4b with Docker Model Runner:
docker model run hf.co/cagataydev/tin-4b
card: Solder-brand card + animated assets (cards/render.py)
Browse files- README.md +74 -5
- assets/banner.svg +1 -1
- assets/family.svg +2 -2
- assets/kept.svg +14 -0
- assets/scorecard.svg +14 -0
README.md
CHANGED
|
@@ -10,7 +10,7 @@ tags: [tin, tin-lang, loopl, on-device, agent, tool-calling, code, qwen3.5, qwen
|
|
| 10 |
---
|
| 11 |
<p align="center"><a href="https://tin.ad"><img src="https://huggingface.co/cagataydev/tin-4b/resolve/main/assets/banner.svg" alt="Tin 4B — Writes Tin the compiler accepts. Runs on your phone." width="100%"></a></p>
|
| 12 |
|
| 13 |
-
<div align="center" style="display:flex;flex-wrap:wrap;gap:6px;justify-content:center"><a href="https://huggingface.co/cagataydev/tin-4b#licence"><img alt="license: Apache 2.0" src="https://img.shields.io/badge/license-Apache%202.0-5b5e66?style=flat-square&labelColor=0d0e10"></a> <img alt="bf16: transformers · 9.08 GB" src="https://img.shields.io/badge/bf16-transformers%20%C2%B7%209.08%20GB-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="params: 4B" src="https://img.shields.io/badge/params-4B-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="tools: tin_check + tin_run" src="https://img.shields.io/badge/tools-tin__check%20%2B%20tin__run-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="tool calling: native + loopl JSON" src="https://img.shields.io/badge/tool%20calling-native%20%2B%20loopl%20JSON-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="status: preview" src="https://img.shields.io/badge/status-preview-5b5e66?style=flat-square&labelColor=0d0e10"> <a href="https://tin.ad"><img alt="site: tin.ad" src="https://img.shields.io/badge/site-tin.ad-5b5e66?style=flat-square&labelColor=0d0e10"></a> <a href="https://huggingface.co/collections/cagataydev/tin-on-device-6afdbdec532d2dd94353c6a3"><img alt="collection: Tin — on-device" src="https://img.shields.io/badge/collection-Tin%20%E2%80%94%20on--device-5b5e66?style=flat-square&labelColor=0d0e10"></a></div>
|
| 14 |
|
| 15 |
# Tin 4B
|
| 16 |
|
|
@@ -19,11 +19,46 @@ tags: [tin, tin-lang, loopl, on-device, agent, tool-calling, code, qwen3.5, qwen
|
|
| 19 |
This repo is the **bf16 weights** (transformers) — the base for further post-tuning. The phone build is [`cagataydev/tin-4b-4bit`](https://huggingface.co/cagataydev/tin-4b-4bit).
|
| 20 |
Post-tuned from [`cagataydev/loopl-4b`](https://huggingface.co/cagataydev/loopl-4b) (itself Qwen/Qwen3.5-4B), so loopl's tool manners and vision are kept. Made by Çağatay Çalı ([@cagataycali](https://github.com/cagataycali)) · tiny.technology.
|
| 21 |
|
| 22 |
-
> **Preview.** These are the scores of the current build (
|
| 23 |
|
| 24 |
## Scorecard
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
### The family
|
| 29 |
|
|
@@ -33,6 +68,33 @@ Not scored yet. The scorecard appears here as soon as the golden-set run for thi
|
|
| 33 |
|---|---:|---:|---:|---:|---:|---:|---|
|
| 34 |
| 0.8B | 93.8 | 50.1 | 37.5 | 88.8 | 89 | 32.5 | [tin-0.8b-4bit](https://huggingface.co/cagataydev/tin-0.8b-4bit) |
|
| 35 |
| 2B | 89.6 | 61.7 | 51 | 96.3 | 91.5 | 45 | [tin-2b-v2-4bit](https://huggingface.co/cagataydev/tin-2b-v2-4bit) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
## Use it
|
| 38 |
|
|
@@ -101,10 +163,17 @@ Thinking is off (an empty `<think>` block). The optional system prompt it was tr
|
|
| 101 |
|
| 102 |
**It can**
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
**It cannot**
|
| 106 |
|
| 107 |
-
-
|
|
|
|
|
|
|
| 108 |
- Check Tin on the phone by itself: the loopl app has no Tin compiler yet.
|
| 109 |
- Promise anything about programs that call real model providers: every eval program uses `model: "mock"` so it runs offline, and live providers were not tested.
|
| 110 |
|
|
@@ -140,4 +209,4 @@ Leak gate against the golden set: program hash, question hash and 3-gram Jaccard
|
|
| 140 |
|
| 141 |
Apache-2.0, like the base [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B). The Tin language and its docs are by Çağatay Çalı; the training data is synthesised from them and from loopl-train (public sources only, no user conversations).
|
| 142 |
|
| 143 |
-
<sub>Card rendered by `cards/render.py` from `evals/results` on
|
|
|
|
| 10 |
---
|
| 11 |
<p align="center"><a href="https://tin.ad"><img src="https://huggingface.co/cagataydev/tin-4b/resolve/main/assets/banner.svg" alt="Tin 4B — Writes Tin the compiler accepts. Runs on your phone." width="100%"></a></p>
|
| 12 |
|
| 13 |
+
<div align="center" style="display:flex;flex-wrap:wrap;gap:6px;justify-content:center"><a href="https://huggingface.co/cagataydev/tin-4b#licence"><img alt="license: Apache 2.0" src="https://img.shields.io/badge/license-Apache%202.0-5b5e66?style=flat-square&labelColor=0d0e10"></a> <img alt="bf16: transformers · 9.08 GB" src="https://img.shields.io/badge/bf16-transformers%20%C2%B7%209.08%20GB-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="params: 4B" src="https://img.shields.io/badge/params-4B-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="tools: tin_check + tin_run" src="https://img.shields.io/badge/tools-tin__check%20%2B%20tin__run-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="tool calling: native + loopl JSON" src="https://img.shields.io/badge/tool%20calling-native%20%2B%20loopl%20JSON-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="writes Tin: 68.3% pass@1" src="https://img.shields.io/badge/writes%20Tin-68.3%25%20pass%401-ff7a1a?style=flat-square&labelColor=0d0e10"> <img alt="status: preview" src="https://img.shields.io/badge/status-preview-5b5e66?style=flat-square&labelColor=0d0e10"> <a href="https://tin.ad"><img alt="site: tin.ad" src="https://img.shields.io/badge/site-tin.ad-5b5e66?style=flat-square&labelColor=0d0e10"></a> <a href="https://huggingface.co/collections/cagataydev/tin-on-device-6afdbdec532d2dd94353c6a3"><img alt="collection: Tin — on-device" src="https://img.shields.io/badge/collection-Tin%20%E2%80%94%20on--device-5b5e66?style=flat-square&labelColor=0d0e10"></a></div>
|
| 14 |
|
| 15 |
# Tin 4B
|
| 16 |
|
|
|
|
| 19 |
This repo is the **bf16 weights** (transformers) — the base for further post-tuning. The phone build is [`cagataydev/tin-4b-4bit`](https://huggingface.co/cagataydev/tin-4b-4bit).
|
| 20 |
Post-tuned from [`cagataydev/loopl-4b`](https://huggingface.co/cagataydev/loopl-4b) (itself Qwen/Qwen3.5-4B), so loopl's tool manners and vision are kept. Made by Çağatay Çalı ([@cagataycali](https://github.com/cagataycali)) · tiny.technology.
|
| 21 |
|
| 22 |
+
> **Preview.** These are the scores of the current build (2026-11-18T14:44). This card is re-rendered when new evals land.
|
| 23 |
|
| 24 |
## Scorecard
|
| 25 |
|
| 26 |
+
<p align="center"><img src="https://huggingface.co/cagataydev/tin-4b/resolve/main/assets/scorecard.svg" alt="Scorecard: Tin 4b against loopl and the base Qwen" width="100%"></p>
|
| 27 |
+
|
| 28 |
+
| probe | **Tin 4B** | loopl 4B | Qwen3.5 4B |
|
| 29 |
+
|---|---:|---:|---:|
|
| 30 |
+
| Says it is Tin <sub>n=48</sub> | **100** | — | — |
|
| 31 |
+
| Tin knowledge <sub>n=515</sub> | **76.1** | — | — |
|
| 32 |
+
| Writes Tin <sub>n=259</sub> | **68.3** | — | — |
|
| 33 |
+
| Fixes Tin <sub>n=107</sub> | **97.2** | — | — |
|
| 34 |
+
| Fixes stacked bugs <sub>n=82</sub> | **93.9** | — | — |
|
| 35 |
+
| Agent loop · native <sub>n=40</sub> | **65** | — | — |
|
| 36 |
+
| Agent loop · loopl JSON <sub>n=40</sub> | **67.5** | — | — |
|
| 37 |
+
|
| 38 |
+
% pass. What each row measures:
|
| 39 |
+
|
| 40 |
+
- **Says it is Tin** — identity: 48 probes, half without a system prompt, incl. "are you Qwen?"
|
| 41 |
+
- **Tin knowledge** — Tin knowledge: 515 exact-answer questions from the docs
|
| 42 |
+
- **Writes Tin** — WRITE: `tin check` passes **and** `tin run` prints the exact expected output (pass@1, greedy)
|
| 43 |
+
- **Fixes Tin** — FIX: a broken program + the real compiler error → it passes
|
| 44 |
+
- **Fixes stacked bugs** — FIX-HARD: 2–3 stacked bugs incl. Rust/TS habits (`let mut`, `->`, `.len()`)
|
| 45 |
+
- **Agent loop · native** — agent loop with real `tin_check` / `tin_run` tools, ≤ 6 turns, native tool dialect
|
| 46 |
+
- **Agent loop · loopl JSON** — the same agent loop in loopl's JSON tool dialect
|
| 47 |
+
|
| 48 |
+
<sub>Qwen3.5 4B baseline is not measured yet; it is added when its golden-set run lands.</sub>
|
| 49 |
+
|
| 50 |
+
Every program is graded by the real Tin compiler (tin@`116bc0f`), never by a model. All three columns are the MLX 4-bit builds on the same Mac, greedy, same prompts; the bf16 weights here score the same or better. Golden set: [`cagataydev/tin-evals`](https://huggingface.co/datasets/cagataydev/tin-evals) *(private)*, held out from training by construction (fresh tasks; dedupe by normalised text, program hash and 3-gram overlap). `—` = not measured for that model.
|
| 51 |
+
|
| 52 |
+
### What it kept from loopl
|
| 53 |
+
|
| 54 |
+
<p align="center"><img src="https://huggingface.co/cagataydev/tin-4b/resolve/main/assets/kept.svg" alt="loopl skills kept" width="100%"></p>
|
| 55 |
+
|
| 56 |
+
| probe | **Tin 4B** | loopl 4B |
|
| 57 |
+
|---|---:|---:|
|
| 58 |
+
| Tool calls · native <sub>n=9</sub> | **88.9** | — |
|
| 59 |
+
| Tool calls · loopl JSON <sub>n=9</sub> | **88.9** | — |
|
| 60 |
+
| Tools quiz <sub>n=60</sub> | **96.7** | — |
|
| 61 |
+
| Strands quiz <sub>n=100</sub> | **31** | — |
|
| 62 |
|
| 63 |
### The family
|
| 64 |
|
|
|
|
| 68 |
|---|---:|---:|---:|---:|---:|---:|---|
|
| 69 |
| 0.8B | 93.8 | 50.1 | 37.5 | 88.8 | 89 | 32.5 | [tin-0.8b-4bit](https://huggingface.co/cagataydev/tin-0.8b-4bit) |
|
| 70 |
| 2B | 89.6 | 61.7 | 51 | 96.3 | 91.5 | 45 | [tin-2b-v2-4bit](https://huggingface.co/cagataydev/tin-2b-v2-4bit) |
|
| 71 |
+
| **4B** | 100 | 76.1 | 68.3 | 97.2 | 93.9 | 65 | [tin-4b-4bit](https://huggingface.co/cagataydev/tin-4b-4bit) |
|
| 72 |
+
|
| 73 |
+
## A real answer
|
| 74 |
+
|
| 75 |
+
From the golden set (`w-approval-02`), exactly as the model wrote it, then run by the compiler:
|
| 76 |
+
|
| 77 |
+
```tin
|
| 78 |
+
/// Stop a server by its id.
|
| 79 |
+
guarded tool fn shutdownServer(id: string): string => "server {id} shutdown"
|
| 80 |
+
|
| 81 |
+
agent Admin {
|
| 82 |
+
model: "mock"
|
| 83 |
+
tools: [shutdownServer]
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
fn main() {
|
| 87 |
+
// No one is here to approve, so the call is denied.
|
| 88 |
+
print(Admin("shutdownServer 'prod-01'"))
|
| 89 |
+
}
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
```console
|
| 93 |
+
$ tin run main.tin
|
| 94 |
+
mock: error: Tool call denied by the user. Do not retry it; continue without it.
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
The tool is `guarded`, so nothing runs without a person's yes; offline there is no one to approve, so the call is denied and the program says so. The model wrote that correctly — it is the point of the language.
|
| 98 |
|
| 99 |
## Use it
|
| 100 |
|
|
|
|
| 163 |
|
| 164 |
**It can**
|
| 165 |
|
| 166 |
+
- Say it is Tin, who made it, and that it is not Qwen or loopl (100 % of 48 probes).
|
| 167 |
+
- Fix a broken program from the compiler's error and `fix:` line (97.2 %), including stacked Rust/TypeScript habits (93.9 %).
|
| 168 |
+
- Write a complete program that compiles and prints exactly the expected output on the first try 68.3 % of the time — agents with model "mock", `guarded tool fn`, servers, tasks.
|
| 169 |
+
- Run the write → `tin_check` → fix → `tin_run` loop and stop when it works (65 % within 6 turns).
|
| 170 |
+
- Still do loopl's job: call phone tools in both dialects and chat about images (vision tower kept).
|
| 171 |
|
| 172 |
**It cannot**
|
| 173 |
|
| 174 |
+
- Be trusted without the compiler: about 32 % of first tries fail `tin check` or print something else. Always run `tin check`.
|
| 175 |
+
- Know every fact in the docs: 76.1 % on exact-answer questions. Fine details (flag names, exact error codes) are often wrong.
|
| 176 |
+
- Know Tin after tin@`116bc0f` (the training commit): newer std functions and syntax are missing.
|
| 177 |
- Check Tin on the phone by itself: the loopl app has no Tin compiler yet.
|
| 178 |
- Promise anything about programs that call real model providers: every eval program uses `model: "mock"` so it runs offline, and live providers were not tested.
|
| 179 |
|
|
|
|
| 209 |
|
| 210 |
Apache-2.0, like the base [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B). The Tin language and its docs are by Çağatay Çalı; the training data is synthesised from them and from loopl-train (public sources only, no user conversations).
|
| 211 |
|
| 212 |
+
<sub>Card rendered by `cards/render.py` from `evals/results` on 2026-11-18T14:44. Brand: Solder (tin.ad).</sub>
|
assets/banner.svg
CHANGED
|
|
|
|
assets/family.svg
CHANGED
|
|
|
|
assets/kept.svg
ADDED
|
|
assets/scorecard.svg
ADDED
|
|