Text Generation
GGUF
Safetensors
English
on-device
code-generation
ui-generation
moldescript
conversational
Instructions to use oyekamal/molde-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use oyekamal/molde-tiny with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf oyekamal/molde-tiny:Q4_K_M # Run inference directly in the terminal: llama cli -hf oyekamal/molde-tiny:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf oyekamal/molde-tiny:Q4_K_M # Run inference directly in the terminal: llama cli -hf oyekamal/molde-tiny:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf oyekamal/molde-tiny:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf oyekamal/molde-tiny:Q4_K_M
Use Docker
docker model run hf.co/oyekamal/molde-tiny:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use oyekamal/molde-tiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "oyekamal/molde-tiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "oyekamal/molde-tiny", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/oyekamal/molde-tiny:Q4_K_M
- Ollama
How to use oyekamal/molde-tiny with Ollama:
ollama run hf.co/oyekamal/molde-tiny:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use oyekamal/molde-tiny with Docker Model Runner:
docker model run hf.co/oyekamal/molde-tiny:Q4_K_M
- Lemonade
How to use oyekamal/molde-tiny with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull oyekamal/molde-tiny:Q4_K_M
Run and chat with the model
lemonade run user.molde-tiny-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Model card: quickstart (app, llama.cpp), honest evaluation, links to GitHub and the release; images
Browse files- .gitattributes +2 -0
- README.md +108 -10
- images/app-ask.png +3 -0
- images/app-change-undo.png +0 -0
- images/app-create.png +0 -0
- images/app-download.png +3 -0
- images/model-vs-handwritten-budget.png +0 -0
.gitattributes
CHANGED
|
@@ -39,3 +39,5 @@ r1-gemma270m/r1-gemma270m-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
|
| 39 |
r1-gemma270m/r1-gemma270m-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
r2-gemma270m/r2-gemma270m-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
r2-gemma270m/r2-gemma270m-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 39 |
r1-gemma270m/r1-gemma270m-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
r2-gemma270m/r2-gemma270m-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
r2-gemma270m/r2-gemma270m-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
images/app-ask.png filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
images/app-download.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -3,6 +3,8 @@ license: other
|
|
| 3 |
license_name: gemma
|
| 4 |
license_link: https://ai.google.dev/gemma/terms
|
| 5 |
base_model: google/gemma-3-270m-it
|
|
|
|
|
|
|
| 6 |
language:
|
| 7 |
- en
|
| 8 |
tags:
|
|
@@ -10,27 +12,123 @@ tags:
|
|
| 10 |
- code-generation
|
| 11 |
- ui-generation
|
| 12 |
- moldescript
|
|
|
|
| 13 |
library_name: gguf
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
# Molde tiny models
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
**
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
-
2. The model writes a short MoldeScript program (about 130 to 200 tokens), guided by a grammar so the syntax cannot be wrong.
|
| 28 |
-
3. The app checks the program and draws it. Saved data is kept across every change.
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
## Licence
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
|
|
|
| 3 |
license_name: gemma
|
| 4 |
license_link: https://ai.google.dev/gemma/terms
|
| 5 |
base_model: google/gemma-3-270m-it
|
| 6 |
+
datasets:
|
| 7 |
+
- oyekamal/molde-data
|
| 8 |
language:
|
| 9 |
- en
|
| 10 |
tags:
|
|
|
|
| 12 |
- code-generation
|
| 13 |
- ui-generation
|
| 14 |
- moldescript
|
| 15 |
+
- gguf
|
| 16 |
library_name: gguf
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
---
|
| 19 |
|
| 20 |
# Molde tiny models
|
| 21 |
|
| 22 |
+
**One tiny model, running offline on a phone, that builds small apps from a chat and changes them when you ask.**
|
| 23 |
|
| 24 |
+
These are the models behind [Molde](https://github.com/Orenda-Project/molde), an idea by Kamal ([oyekamal](https://github.com/oyekamal)), built in the open by [Orenda Project](https://github.com/Orenda-Project). The model writes **MoldeScript**, a small strict language for personal tools (trackers, lists, counters, planners, calculators, timers). The Molde app checks the program and draws it as a working screen. Nothing leaves the phone.
|
| 25 |
|
| 26 |
+
**Early research software.** It works end to end, and it still makes plenty of mistakes; the numbers below say how many.
|
| 27 |
|
| 28 |
+
| Make an app | Change it, with Undo | It asks when unsure |
|
| 29 |
+
|---|---|---|
|
| 30 |
+
| <img src="https://huggingface.co/oyekamal/molde-tiny/resolve/main/images/app-create.png" width="220"> | <img src="https://huggingface.co/oyekamal/molde-tiny/resolve/main/images/app-change-undo.png" width="220"> | <img src="https://huggingface.co/oyekamal/molde-tiny/resolve/main/images/app-ask.png" width="220"> |
|
| 31 |
|
| 32 |
+
## Which file to use
|
|
|
|
|
|
|
| 33 |
|
| 34 |
+
| File | Size | Use |
|
| 35 |
+
|---|---|---|
|
| 36 |
+
| `r2-gemma270m/r2-gemma270m-Q4_K_M.gguf` | 241 MB | **Recommended.** Phones with 3 to 4 GB of memory, laptops |
|
| 37 |
+
| `r2-gemma270m/r2-gemma270m-Q8_0.gguf` | 278 MB | slightly more accurate, a little more memory |
|
| 38 |
+
| `r1-gemma270m/` | | the previous round, kept for comparison |
|
| 39 |
+
| `smoke-r0/` | | a pipeline test; do not use |
|
| 40 |
|
| 41 |
+
Base model: Gemma 3 270M instruct (`google/gemma-3-270m-it`, via the ungated mirror `unsloth/gemma-3-270m-it`), full fine-tune. `models.json` lists the files with sizes and SHA-256 hashes; the app reads it to offer models. Each round folder has its own card with training details.
|
| 42 |
+
|
| 43 |
+
## Quickstart
|
| 44 |
+
|
| 45 |
+
### Android app
|
| 46 |
+
|
| 47 |
+
Download the APK from the [v0.3.0 release](https://github.com/Orenda-Project/molde/releases/tag/v0.3.0) (`arm64-v8a` for phones, `x86_64` for the emulator), install it, open it. It downloads the recommended model from this repo once, then works offline.
|
| 48 |
+
|
| 49 |
+
### llama.cpp on a laptop
|
| 50 |
+
|
| 51 |
+
```bash
|
| 52 |
+
curl -L -o molde-r2-q4.gguf https://huggingface.co/oyekamal/molde-tiny/resolve/main/r2-gemma270m/r2-gemma270m-Q4_K_M.gguf
|
| 53 |
+
curl -L -o moldescript.gbnf https://raw.githubusercontent.com/Orenda-Project/molde/main/lang/moldescript.gbnf
|
| 54 |
+
|
| 55 |
+
cat > prompt.txt <<'EOF'
|
| 56 |
+
<start_of_turn>user
|
| 57 |
+
You write MoldeScript, a tiny language for small phone apps. Reply with the complete program only, no explanation. For an edit request you get the current program: reply with the full updated program.
|
| 58 |
+
|
| 59 |
+
Request: a reading log: book title, pages read each day, and a chart of pages over the last 7 days<end_of_turn>
|
| 60 |
+
<start_of_turn>model
|
| 61 |
+
EOF
|
| 62 |
+
|
| 63 |
+
llama-completion -m molde-r2-q4.gguf --grammar-file moldescript.gbnf -f prompt.txt \
|
| 64 |
+
-n 600 --temp 0 -no-cnv --no-display-prompt 2>/dev/null | sed '/\[end of text\]/d' > app.mo
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
Output (r2 Q4_K_M, llama.cpp b12144, laptop CPU, about 4 s):
|
| 68 |
+
|
| 69 |
+
```
|
| 70 |
+
app "Reading log" book ink
|
| 71 |
+
table page_log title text, mins num 1..600, pages num 1..500
|
| 72 |
+
form page_log
|
| 73 |
+
daybars last 7 days, sum(page_log.pages on it)
|
| 74 |
+
list page_log by day
|
| 75 |
+
remind "Time to add reading" at 21:00
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
Check it and read it in plain English with the checker from the GitHub repo (Node 20, no install): `node lang/mo.mjs check app.mo` and `node lang/mo.mjs describe app.mo`. For an edit, the user text is `Edit request: <change>\n\nCurrent program:\n<program>`. Full steps: [README on GitHub](https://github.com/Orenda-Project/molde#2-the-model-on-a-laptop-with-llamacpp).
|
| 79 |
+
|
| 80 |
+
Use greedy decoding and the grammar. The app also uses a line-by-line name decoder (branch `phase-2-decode`), which is how the numbers below were measured.
|
| 81 |
+
|
| 82 |
+
## Evaluation
|
| 83 |
+
|
| 84 |
+
All on the quantized file that ships (Q4_K_M), llama.cpp b12144, greedy, line-stepped decoder.
|
| 85 |
+
|
| 86 |
+
**140 new app ideas** the model never saw, written to sound like real people:
|
| 87 |
+
|
| 88 |
+
| | r1 | r2 | hand-written reference |
|
| 89 |
+
|---|---|---|---|
|
| 90 |
+
| program valid and runs | 76.4% | **81.4%** | 100% |
|
| 91 |
+
| app works when used (add a row, see it) | 65.7% | **77.9%** | 97.1% |
|
| 92 |
+
| must-have features present | 29.8% | **41.5%** | 99.4% |
|
| 93 |
+
| every must-have present | 2.1% | **7.1%** | 95.7% |
|
| 94 |
+
| median seconds per app, laptop CPU | 9.1 | **3.7** | |
|
| 95 |
+
|
| 96 |
+
**heldout2** (149 requests: 100 create, 29 edit, 10 ask, 10 out of scope):
|
| 97 |
+
|
| 98 |
+
| | r1 | r2 |
|
| 99 |
+
|---|---|---|
|
| 100 |
+
| checker pass, all | 84.6% | **90.6%** |
|
| 101 |
+
| creates / edits / asks / out of scope | 79 / 100 / 100 / 80% | **87 / 100 / 100 / 90%** |
|
| 102 |
+
| blind judge on the 100 creates, "does what was asked": yes / partly / no | 24 / 64 / 12 | **42 / 54 / 4** |
|
| 103 |
+
|
| 104 |
+
### Limitations
|
| 105 |
+
|
| 106 |
+
- Apps look plainer than hand-written ones; the model copies the simple look of its training data.
|
| 107 |
+
- Small changes to long apps often drop sections (about 1 in 4 fully correct in one test).
|
| 108 |
+
- A valid app often misses part of what was asked.
|
| 109 |
+
- Very short requests ("todo") can trigger a question instead of an app.
|
| 110 |
+
- English only. MoldeScript cannot make games or call the internet.
|
| 111 |
+
- Speed on a real low-end phone is not measured yet.
|
| 112 |
+
|
| 113 |
+
Dataset v3 targets the first three; the next round (r3) trains on it.
|
| 114 |
+
|
| 115 |
+
<img src="https://huggingface.co/oyekamal/molde-tiny/resolve/main/images/model-vs-handwritten-budget.png" width="640">
|
| 116 |
+
|
| 117 |
+
*Left two: hand-written MoldeScript. Right: the r2 model for the same request. Valid and working, but plainer.*
|
| 118 |
+
|
| 119 |
+
## Training data and reproducing
|
| 120 |
+
|
| 121 |
+
- Data: [oyekamal/molde-data](https://huggingface.co/datasets/oyekamal/molde-data) (synthetic, every program checker-verified). r2: v2, 14,124 train pairs, 8 epochs, lr 5e-5, batch 8 x 2, one L4, about 12 min per epoch.
|
| 122 |
+
- How to build the data, train, export (including the turn-token fix) and evaluate: [TRAINING.md](https://github.com/Orenda-Project/molde/blob/main/TRAINING.md).
|
| 123 |
+
|
| 124 |
+
## Links
|
| 125 |
+
|
| 126 |
+
- Code, language, app: [github.com/Orenda-Project/molde](https://github.com/Orenda-Project/molde)
|
| 127 |
+
- Android release: [v0.3.0](https://github.com/Orenda-Project/molde/releases/tag/v0.3.0)
|
| 128 |
+
- Web demo of hand-written apps: [orenda-project.github.io/molde/demo](https://orenda-project.github.io/molde/demo/)
|
| 129 |
|
| 130 |
## Licence
|
| 131 |
|
| 132 |
+
These models are fine-tuned from Gemma 3 270M. Gemma is provided under and subject to the Gemma Terms of Use found at [ai.google.dev/gemma/terms](https://ai.google.dev/gemma/terms), including the [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy). Anyone using these files agrees to those terms. The Molde code and the MoldeScript language are Apache-2.0; the dataset is CC BY 4.0.
|
| 133 |
+
|
| 134 |
+
Made by Kamal ([oyekamal](https://huggingface.co/oyekamal)) and Orenda Project.
|
images/app-ask.png
ADDED
|
Git LFS Details
|
images/app-change-undo.png
ADDED
|
images/app-create.png
ADDED
|
images/app-download.png
ADDED
|
Git LFS Details
|
images/model-vs-handwritten-budget.png
ADDED
|