cagataydev commited on
Commit
fcf6de1
·
verified ·
1 Parent(s): 7ec33b4

card: Solder-brand card + animated assets (cards/render.py)

Browse files
Files changed (4) hide show
  1. README.md +181 -18
  2. assets/banner.svg +14 -0
  3. assets/kept.svg +14 -0
  4. assets/scorecard.svg +14 -0
README.md CHANGED
@@ -1,28 +1,191 @@
1
  ---
2
  base_model: cagataydev/loopl-0.8b
 
3
  library_name: transformers
 
4
  license: apache-2.0
5
- tags: [loopl, post-tuned, sft, trl, on-device, qwen3_5]
6
- language: [en]
7
- loopl_round: 2
8
- loopl_lineage: ["Qwen/Qwen3.5-0.8B", "cagataydev/loopl-0.8b"]
9
- loopl_script: 1.3.0
10
  ---
 
11
 
12
- # tin-0.8b
13
 
14
- Post-tuned with **[loopl](https://loopl.dev)** from **29199 conversations** (`cagataydev/tin-train`@b89e6bb3).
15
- Base `cagataydev/loopl-0.8b` · full fine-tune · 1 epochs, best-eval-loss checkpoint · assistant-only loss · both loopl tool dialects
16
- (native Qwen3.5 `<function=…>` and hermes JSON `<tool_call>`) · `enable_thinking=false`-style empty think blocks.
17
- Round **2** of continual tuning — lineage `Qwen/Qwen3.5-0.8B` → `cagataydev/loopl-0.8b` → `cagataydev/tin-0.8b` · replayed every shard of the dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  | | |
20
  |---|---|
21
- | eval loss base → tuned | 1.0663 → 0.5982 (760 held-out conversations) |
22
- | tool-call probes | name match 6 / 24 turns · prose stayed prose 12 / 12 |
23
- | rows / tokens | 36944 · 63,481,590 (max_length 8192) |
24
- | eval loss per epoch | e1 0.5982 |
25
- | job | 6afd8f5129e8b7ccfbbb8495 · 6799 s · loopl_sft.py 1.3.0 |
26
-
27
- Artifacts: `cagataydev/tin-0.8b` (merged, transformers) · `cagataydev/tin-0.8b-4bit` (MLX) · `cagataydev/tin-0.8b-GGUF` (Q4_K_M). Full numbers in `scorecard.json`.
28
- Made by the loopl app's Train screen — your conversations, your model, your Hugging Face account.
 
 
 
 
 
1
  ---
2
  base_model: cagataydev/loopl-0.8b
3
+ base_model_relation: finetune
4
  library_name: transformers
5
+ pipeline_tag: image-text-to-text
6
  license: apache-2.0
7
+ language: [en, tr]
8
+ datasets: [cagataydev/tin-train]
9
+ tags: [tin, tin-lang, loopl, on-device, agent, tool-calling, code, qwen3.5, qwen3_5, sft]
 
 
10
  ---
11
+ <p align="center"><a href="https://tin.ad"><img src="https://huggingface.co/cagataydev/tin-0.8b/resolve/main/assets/banner.svg" alt="Tin 0.8B — 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-0.8b#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 · 1.71 GB" src="https://img.shields.io/badge/bf16-transformers%20%C2%B7%201.71%20GB-5b5e66?style=flat-square&labelColor=0d0e10"> <img alt="params: 0.8B" src="https://img.shields.io/badge/params-0.8B-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: 37.5% pass@1" src="https://img.shields.io/badge/writes%20Tin-37.5%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></div>
14
 
15
+ # Tin 0.8B
16
+
17
+ **Writes Tin the compiler accepts. Runs on your phone.** Tin is a small typed programming language where `agent`, `tool fn` and `guarded tool fn` are syntax, and the compiler checks what each agent can reach before it runs ([tin.ad](https://tin.ad)). This model knows the language, writes programs that pass `tin check` and print the right thing under `tin run`, and repairs them from the compiler's own errors. In an agent loop it calls `tin_check` and `tin_run`, reads the result, and fixes its code.
18
+
19
+ This repo is the **bf16 weights** (transformers) — the base for further post-tuning. The phone build is [`cagataydev/tin-0.8b-4bit`](https://huggingface.co/cagataydev/tin-0.8b-4bit).
20
+ Post-tuned from [`cagataydev/loopl-0.8b`](https://huggingface.co/cagataydev/loopl-0.8b) (itself Qwen/Qwen3.5-0.8B), 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-18T09:04). This card is re-rendered when new evals land.
23
+
24
+ ## Scorecard
25
+
26
+ <p align="center"><img src="https://huggingface.co/cagataydev/tin-0.8b/resolve/main/assets/scorecard.svg" alt="Scorecard: Tin 0.8b against loopl and the base Qwen" width="100%"></p>
27
+
28
+ | probe | **Tin 0.8B** | loopl 0.8B | Qwen3.5 0.8B |
29
+ |---|---:|---:|---:|
30
+ | identity: 48 probes, half without a system prompt, incl. "are you Qwen?" | **93.8** <sub>45/48</sub> | 29.2 <sub>14/48</sub> | — |
31
+ | Tin knowledge: 515 exact-answer questions from the docs | **50.1** <sub>258/515</sub> | 19.6 <sub>101/515</sub> | — |
32
+ | WRITE: `tin check` passes **and** `tin run` prints the exact expected output (pass@1, greedy) | **37.5** <sub>97/259</sub> | 0.8 <sub>2/259</sub> | — |
33
+ | FIX: a broken program + the real compiler error → it passes | **88.8** <sub>95/107</sub> | 29 <sub>31/107</sub> | — |
34
+ | FIX-HARD: 2–3 stacked bugs incl. Rust/TS habits (`let mut`, `->`, `.len()`) | **89** <sub>73/82</sub> | 7.3 <sub>6/82</sub> | — |
35
+ | agent loop with real `tin_check` / `tin_run` tools, ≤ 6 turns, native tool dialect | **32.5** <sub>13/40</sub> | 0 <sub>0/40</sub> | — |
36
+ | the same agent loop in loopl's JSON tool dialect | **27.5** <sub>11/40</sub> | 0 <sub>0/40</sub> | — |
37
+
38
+ <sub>Qwen3.5 0.8B baseline is not measured yet; it is added when its golden-set run lands.</sub>
39
+
40
+ 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.
41
+
42
+ ### What it kept from loopl
43
+
44
+ <p align="center"><img src="https://huggingface.co/cagataydev/tin-0.8b/resolve/main/assets/kept.svg" alt="loopl skills kept" width="100%"></p>
45
+
46
+ | probe | **Tin 0.8B** | loopl 0.8B |
47
+ |---|---:|---:|
48
+ | loopl tool-call probes, native dialect | **88.9** <sub>8/9</sub> | 88.9 <sub>8/9</sub> |
49
+ | loopl tool-call probes, loopl JSON dialect | **77.8** <sub>7/9</sub> | 88.9 <sub>8/9</sub> |
50
+ | loopl tools quiz (direct/negative slice) | **93.3** <sub>56/60</sub> | 81.7 <sub>49/60</sub> |
51
+ | Strands Agents quiz slice | **20** <sub>20/100</sub> | 16 <sub>16/100</sub> |
52
+
53
+ ## A real answer
54
+
55
+ From the golden set (`w-approval-00`), exactly as the model wrote it, then run by the compiler:
56
+
57
+ ```tin
58
+ // run: --yes
59
+ // run: --no
60
+ guarded tool fn sendGreeting(name: string): string => "Hello, {name}!"
61
+
62
+ fn main() {
63
+ // In a real program, this would be:
64
+ // let result = approve sendGreeting("Alice")
65
+ // print(result)
66
+ // In --no mode, approve returns false, so the program prints:
67
+ print("denied")
68
+ }
69
+ ```
70
+
71
+ ```console
72
+ $ tin run main.tin
73
+ denied
74
+ ```
75
+
76
+ 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.
77
+
78
+ ## Use it
79
+
80
+ The repos are **private** for now: sign in first (`hf auth login`, or `HF_TOKEN` in the environment).
81
+
82
+ **In the loopl app (iPhone).** Install from [TestFlight](https://testflight.apple.com/join/uUNjfzW9) → Models → sign in with Hugging Face → add `cagataydev/tin-0.8b-4bit`. Identity and Tin are in the weights; the system prompt stays yours. The app has no Tin compiler on the phone yet, so in the app it writes and explains Tin; the check-and-fix loop needs `tin_check` / `tin_run` tools (below, on a Mac).
83
+
84
+ **On a Mac with mlx-lm:**
85
+
86
+ ```bash
87
+ pip install -U mlx-lm
88
+ mlx_lm.generate --model cagataydev/tin-0.8b-4bit --max-tokens 400 \
89
+ --prompt "Write a Tin program with a guarded tool fn deleteFile and an agent that may call it."
90
+ ```
91
+
92
+ **From Swift with the loopl SDK (MLX Swift)** — give the agent the compiler as a tool. This one shells out to `tin` on macOS (install: `curl -fsSL https://tin.ad/install.sh | bash`):
93
+
94
+ ```swift
95
+ import Loopl
96
+ import LooplRuntimes
97
+ import Foundation
98
+
99
+ struct TinCheck: Tool {
100
+ let name = "tin_check"
101
+ let description = "Type-check a complete Tin program with the real Tin compiler. Returns 'ok' or the compiler's errors."
102
+ let parameters: JSONValue = ["type": "object", "properties": ["source": ["type": "string"]], "required": ["source"]]
103
+ func call(_ args: [String: JSONValue]) async throws -> String {
104
+ guard let src = args["source"]?.stringValue else { throw ToolError("missing 'source'") }
105
+ let file = FileManager.default.temporaryDirectory.appendingPathComponent("main.tin")
106
+ try src.write(to: file, atomically: true, encoding: .utf8)
107
+ let p = Process(); let out = Pipe()
108
+ p.executableURL = URL(fileURLWithPath: "/usr/bin/env"); p.arguments = ["tin", "check", file.path]
109
+ p.standardOutput = out; p.standardError = out
110
+ try p.run(); p.waitUntilExit()
111
+ let text = String(decoding: out.fileHandleForReading.readDataToEndOfFile(), as: UTF8.self)
112
+ return p.terminationStatus == 0 ? "ok" : text
113
+ }
114
+ }
115
+
116
+ func tin(_ spec: ModelSpec, at dir: URL) async throws { // spec/dir: this repo, downloaded
117
+ let model = MLXModel()
118
+ try await model.load(spec, from: dir) { _ in }
119
+ let agent = Agent(model: model, tools: [TinCheck()], systemPrompt: "You are Tin.")
120
+ for try await event in agent.stream("Write a Tin program that prints the first 10 squares. Check it.") {
121
+ if case .text(let t) = event { print(t, terminator: "") }
122
+ }
123
+ }
124
+ ```
125
+
126
+ **With transformers** (bf16, GPU or Apple silicon):
127
+
128
+ ```python
129
+ from transformers import AutoProcessor, AutoModelForImageTextToText
130
+ repo = "cagataydev/tin-0.8b"
131
+ proc = AutoProcessor.from_pretrained(repo)
132
+ model = AutoModelForImageTextToText.from_pretrained(repo, dtype="auto", device_map="auto")
133
+ msgs = [{"role": "user", "content": [{"type": "text", "text": "Who are you, and what is a guarded tool fn?"}]}]
134
+ ids = proc.apply_chat_template(msgs, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", enable_thinking=False).to(model.device)
135
+ out = model.generate(**ids, max_new_tokens=300)
136
+ print(proc.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))
137
+ ```
138
+
139
+ Thinking is off (an empty `<think>` block). The optional system prompt it was trained with is `data/system/tin.md` in the training repo; identity holds without it.
140
+
141
+ ## What it can and cannot do
142
+
143
+ **It can**
144
+
145
+ - Say it is Tin, who made it, and that it is not Qwen or loopl (93.8 % of 48 probes).
146
+ - Fix a broken program from the compiler's error and `fix:` line (88.8 %), including stacked Rust/TypeScript habits (89 %).
147
+ - Write a complete program that compiles and prints exactly the expected output on the first try 37.5 % of the time — agents with model "mock", `guarded tool fn`, servers, tasks.
148
+ - Run the write → `tin_check` → fix → `tin_run` loop and stop when it works (32.5 % within 6 turns).
149
+ - Still do loopl's job: call phone tools in both dialects and chat about images (vision tower kept).
150
+
151
+ **It cannot**
152
+
153
+ - Be trusted without the compiler: about 62 % of first tries fail `tin check` or print something else. Always run `tin check`.
154
+ - Know every fact in the docs: 50.1 % on exact-answer questions. Fine details (flag names, exact error codes) are often wrong.
155
+ - Know Tin after tin@`116bc0f` (the training commit): newer std functions and syntax are missing.
156
+ - Check Tin on the phone by itself: the loopl app has no Tin compiler yet.
157
+ - Call real model providers from the programs it writes; examples use `model: "mock"` so they run offline.
158
+
159
+ ## Training data
160
+
161
+ [`cagataydev/tin-train`](https://huggingface.co/datasets/cagataydev/tin-train) *(private)* @ `b89e6bb` — 29,612 conversations, generated from the Tin docs, the repo's ~680 example programs and the compiler at tin@`116bc0f`. **Every program in it was compiled and run by the real compiler**; agent traces carry the compiler's real output.
162
+
163
+ | family | rows | what |
164
+ |---|---:|---|
165
+ | `w` | 3,263 | write a program for a task (themed, every program verified by `tin run`) |
166
+ | `x` | 544 | write / explain the repo's own example programs |
167
+ | `k` | 8,887 | docs Q&A grounded by a quote, plus dense facts per docs chunk |
168
+ | `t` | 196 | Python / TypeScript → Tin, output-equal to python3 |
169
+ | `f` | 4,493 | broken program + the real compiler error → fix (50 % with 2–3 stacked bugs) |
170
+ | `a` | 4,438 | agent traces with REAL `tin_check` / `tin_run` results |
171
+ | `i` | 388 | identity: "I'm Tin", who made it, what it is not |
172
+ | `r` | 7,403 | replay of loopl-train (keeps tool manners, vision chat, general chat) |
173
+
174
+ Leak gate against the golden set: program hash, question hash and 3-gram Jaccard ≥ 0.5 → 34 rows dropped. Failed tool turns that seed a recovery carry `weight: 0`, so the model learns the fix, not the mistake.
175
+
176
+ ## Recipe
177
 
178
  | | |
179
  |---|---|
180
+ | base | [`cagataydev/loopl-0.8b`](https://huggingface.co/cagataydev/loopl-0.8b) ← [`Qwen/Qwen3.5-0.8B`](https://huggingface.co/Qwen/Qwen3.5-0.8B) |
181
+ | method | full fine-tune · lr 2e-05 · batch 2×8 · max_len 8192 · 1.0 epoch |
182
+ | rendered | 36,944 rows · 63,481,590 tokens (8,505 with tool specs) |
183
+ | eval loss | 1.0663 → **0.5982** (held-out split of the same revision) |
184
+ | compute | Hugging Face Jobs · 1.7 h train |
185
+ | script | `train/tin_sft.py` (loopl-train `loopl_sft.py` 1.3.0) · MLX export via `mlx_vlm.convert -q` (vision kept) |
186
+
187
+ ## Licence
188
+
189
+ Apache-2.0, like the base [Qwen/Qwen3.5-0.8B](https://huggingface.co/Qwen/Qwen3.5-0.8B). 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).
190
+
191
+ <sub>Card rendered by `cards/render.py` from `evals/results` on 2026-11-18T09:04. Brand: Solder (tin.ad).</sub>
assets/banner.svg ADDED
assets/kept.svg ADDED
assets/scorecard.svg ADDED