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
|
Download README.md from oyekamal/molde-tiny: direct link, hf CLI and curl.
- Browser
- Download file 11.1 kB
-
https://huggingface.co/oyekamal/molde-tiny/resolve/main/README.md
- Command line
-
hf download hf://oyekamal/molde-tiny/README.md
-
curl -L -o README.md https://huggingface.co/oyekamal/molde-tiny/resolve/main/README.md
11.1 kB
| license: other | |
| license_name: gemma | |
| license_link: https://ai.google.dev/gemma/terms | |
| base_model: google/gemma-3-270m-it | |
| datasets: | |
| - oyekamal/molde-data | |
| language: | |
| - en | |
| tags: | |
| - on-device | |
| - code-generation | |
| - ui-generation | |
| - moldescript | |
| - gguf | |
| library_name: gguf | |
| pipeline_tag: text-generation | |
| # Molde tiny models | |
| Can one very small model, trained for a single job, replace the pile of one-purpose apps on a phone? You type what you want. A fine-tuned Gemma 3 270M (a 241 MB file) writes the app, offline, inside an Android app. The data stays on the phone. There are no templates: the model writes every app. It writes **MoldeScript**, a small language with its own checker, through a line-stepped constrained decoder (llama.cpp b12144). | |
| Molde is an idea by Kamal ([oyekamal](https://github.com/oyekamal)), built in the open by [Orenda Project](https://github.com/Orenda-Project). This is early research software. It works end to end and it still makes many mistakes. The numbers below say how many. | |
| ## Results | |
| All numbers come from our own tests, on the Q4_K_M files, greedy decoding. The raw cases and reports are in the GitHub repo, folder [`failhunt/`](https://github.com/Orenda-Project/molde/tree/failhunt/failhunt) on branch `failhunt` (see [`failhunt/REPORT.md`](https://github.com/Orenda-Project/molde/blob/failhunt/failhunt/REPORT.md)), and in `r4/REPORT.md` (the Qwen round-4 report; it is not on GitHub yet). | |
| | What we measured | Result | | |
| |---|---| | |
| | Valid program on 149 held-out requests (round 3 Gemma) | **90.6%** | | |
| | Built exactly what was asked, on 407 brand-new requests (round 3 Gemma) | **37%** | | |
| | Built at least the right kind of app, same 407 requests | **71%** | | |
| | Small changes to an app, 40 test cases: round 3 Gemma | 14 of 40 right | | |
| | Small changes, 40 test cases: Qwen 0.8B (round 4, pass 1) | 22 of 40 right (about twice the size, and slower) | | |
| | Speed on a laptop CPU, 4 threads | about 2 s for a new app, 5 to 6 s for a small change | | |
| How to read this: | |
| - The 90.6% measures **validity**: the program passes the MoldeScript checker. It does not measure whether the app does what was asked. The 37% and 71% figures measure that, and they are the honest ones. | |
| - Long requests with specifics, and requests the language cannot express, fail most. | |
| - No phone timings were measured. The speeds above are from a laptop. | |
| ## Work in progress | |
| The current training round writes a change as short edit instructions against numbered lines, instead of rewriting the whole program. It also uses cleaned data. In our own plain tests it gets far more changes right: 141 of 296 forced changes, against 43 for round 3. It is **not in the app and not released here yet**, and it has not been tested inside the app. Treat that result as unconfirmed until it is. | |
| ## The two models the app offers | |
| | Model | File | Size | For | | |
| |---|---|---|---| | |
| | Molde Gemma 270M (default) | `r3-gemma270m/r3-gemma270m-Q4_K_M.gguf` | 241 MB | phones with 3 to 4 GB of memory | | |
| | Molde Qwen 0.8B (optional) | `r4-qwen35-0.8b/r4-qwen35-0.8b-ep1-Q4_K_M.gguf` | 504 MB | phones with 6 GB, higher quality, slower | | |
| `models.json` lists these files with sizes and SHA-256 hashes. The app reads it to offer models. A file enters `models.json` only after it beats the current entry in the full evaluation. Base models: Gemma 3 270M instruct (`google/gemma-3-270m-it`, via the ungated mirror `unsloth/gemma-3-270m-it`) (full fine-tune) and Qwen 0.8B (ChatML prompt). | |
| | Make an app | Change it, with Undo | It asks when unsure | | |
| |---|---|---| | |
| | <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"> | | |
| ## Limitations | |
| - About 6 in 10 new requests do not produce exactly the app that was asked for. | |
| - Long requests with many specifics lose some of the specifics. | |
| - Requests the language cannot express (voice input, the internet, games) are sometimes built as if they were possible. | |
| - Small changes often fail. Round 3 got 14 of 40 right, and changes to long programs fail most. | |
| - Apps look plainer than hand-written ones. | |
| - English works best. Roman Urdu and mixed requests work worse, because the training data covers them thinly. | |
| - Speed on a real phone is not measured. | |
| ## Links | |
| - Code, language, app: [github.com/Orenda-Project/molde](https://github.com/Orenda-Project/molde) | |
| - Data: [oyekamal/molde-data](https://huggingface.co/datasets/oyekamal/molde-data) | |
| - Browser demo: [orenda-project.github.io/molde/demo](https://orenda-project.github.io/molde/demo/). It shows hand-written example apps, not model output. | |
| - Android release: [v0.3.0](https://github.com/Orenda-Project/molde/releases/tag/v0.3.0) | |
| - How to train your own: [TRAINING.md](https://github.com/Orenda-Project/molde/blob/main/TRAINING.md) | |
| ## Quickstart (older r2 file) | |
| ### Android app | |
| 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. | |
| ### llama.cpp on a laptop | |
| ```bash | |
| curl -L -o molde-r2-q4.gguf https://huggingface.co/oyekamal/molde-tiny/resolve/main/r2-gemma270m/r2-gemma270m-Q4_K_M.gguf | |
| curl -L -o moldescript.gbnf https://raw.githubusercontent.com/Orenda-Project/molde/main/lang/moldescript.gbnf | |
| cat > prompt.txt <<'EOF' | |
| <start_of_turn>user | |
| 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. | |
| Request: a reading log: book title, pages read each day, and a chart of pages over the last 7 days<end_of_turn> | |
| <start_of_turn>model | |
| EOF | |
| llama-completion -m molde-r2-q4.gguf --grammar-file moldescript.gbnf -f prompt.txt \ | |
| -n 600 --temp 0 -no-cnv --no-display-prompt 2>/dev/null | sed '/\[end of text\]/d' > app.mo | |
| ``` | |
| Output (r2 Q4_K_M, llama.cpp b12144, laptop CPU, about 4 s): | |
| ``` | |
| app "Reading log" book ink | |
| table page_log title text, mins num 1..600, pages num 1..500 | |
| form page_log | |
| daybars last 7 days, sum(page_log.pages on it) | |
| list page_log by day | |
| remind "Time to add reading" at 21:00 | |
| ``` | |
| 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). | |
| 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. | |
| ## Earlier round-2 results | |
| These are the round 1 and round 2 figures from the first release. They are kept for the record. Read them with the caveat above: they measure validity and simple use, not whether the app matches the request. | |
| All on the quantized file that ships (Q4_K_M), llama.cpp b12144, greedy, line-stepped decoder. | |
| **140 new app ideas** the model never saw, written to sound like real people: | |
| | | r1 | r2 | hand-written reference | | |
| |---|---|---|---| | |
| | program valid and runs | 76.4% | **81.4%** | 100% | | |
| | app works when used (add a row, see it) | 65.7% | **77.9%** | 97.1% | | |
| | must-have features present | 29.8% | **41.5%** | 99.4% | | |
| | every must-have present | 2.1% | **7.1%** | 95.7% | | |
| | median seconds per app, laptop CPU | 9.1 | **3.7** | | | |
| **heldout2** (149 requests: 100 create, 29 edit, 10 ask, 10 out of scope): | |
| | | r1 | r2 | | |
| |---|---|---| | |
| | checker pass, all | 84.6% | **90.6%** | | |
| | creates / edits / asks / out of scope | 79 / 100 / 100 / 80% | **87 / 100 / 100 / 90%** | | |
| | blind judge on the 100 creates, "does what was asked": yes / partly / no | 24 / 64 / 12 | **42 / 54 / 4** | | |
| **Read the heldout2 figures with care.** They measure program validity (the program passes the checker), not whether the app does what was asked. On a separate failure hunt with 407 brand-new requests, the recommended r3 Gemma 270M built exactly what was asked 37% of the time (71% leniently), and 87.7% of its programs were valid. For comparison, heldout2 checker pass for r3 Gemma is 90.6%. | |
| <img src="https://huggingface.co/oyekamal/molde-tiny/resolve/main/images/model-vs-handwritten-budget.png" width="640"> | |
| *Left two: hand-written MoldeScript. Right: the r2 model for the same request. Valid and working, but plainer.* | |
| ## Files | |
| | File | Size | Use | | |
| |---|---|---| | |
| | `r3-gemma270m/r3-gemma270m-Q4_K_M.gguf` | 241 MB | **Default in the app** | | |
| | `r4-qwen35-0.8b/r4-qwen35-0.8b-ep1-Q4_K_M.gguf` | 504 MB | optional, 6 GB phones | | |
| | `r2-gemma270m/r2-gemma270m-Q4_K_M.gguf` | 241 MB | the quickstart file above | | |
| | `r2-gemma270m/r2-gemma270m-Q8_0.gguf` | 278 MB | slightly more accurate, a little more memory | | |
| | `r1-gemma270m/` | | the first round, kept for comparison | | |
| | `smoke-r0/` | | a pipeline test; do not use | | |
| Each round folder has its own card with training details. | |
| ## Training data and reproducing | |
| - Data: [oyekamal/molde-data](https://huggingface.co/datasets/oyekamal/molde-data) (synthetic, every program checker-verified). r2 used v2: 14,124 train pairs, 8 epochs, lr 5e-5, batch 8 x 2, one L4. | |
| - How to build the data, train, export and evaluate: [TRAINING.md](https://github.com/Orenda-Project/molde/blob/main/TRAINING.md). | |
| ## Licence | |
| 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. | |
| Made by Kamal ([oyekamal](https://huggingface.co/oyekamal)) and Orenda Project. | |
| ## Other files (research) | |
| Nothing was deleted. These files are kept for research and comparison; they are not offered in the app (older rounds r1 to r3 Q8 and r2, the Qwen r2 files, other r4 epochs, Q8_0 files; untested unless a model card says otherwise). Full-precision weights are in the `hf/` folders where listed. | |
| - `r1-gemma270m/r1-gemma270m-Q4_K_M.gguf` | |
| - `r1-gemma270m/r1-gemma270m-Q8_0.gguf` | |
| - `r2-gemma270m/r2-gemma270m-Q4_K_M.gguf` | |
| - `r2-gemma270m/r2-gemma270m-Q8_0.gguf` | |
| - `r2-qwen35-0.8b/r2-qwen35-0.8b-Q4_K_M.gguf` | |
| - `r2-qwen35-0.8b/r2-qwen35-0.8b-Q8_0.gguf` | |
| - `r3-gemma270m/r3-gemma270m-Q4_K_M.gguf` (in the app list) | |
| - `r3-gemma270m/r3-gemma270m-Q8_0.gguf` | |
| - `r4-gemma270m/r4-gemma270m-ep2-Q4_K_M.gguf` | |
| - `r4-gemma270m/r4-gemma270m-ep2-Q8_0.gguf` | |
| - `r4-qwen35-0.8b/r4-qwen35-0.8b-ep1-Q4_K_M.gguf` (in the app list) | |
| - `r4-qwen35-0.8b/r4-qwen35-0.8b-ep2-Q4_K_M.gguf` | |
| - `r4-qwen35-0.8b/r4-qwen35-0.8b-ep3-Q4_K_M.gguf` | |
| - `r4-qwen35-0.8b/r4-qwen35-0.8b-ep3-Q8_0.gguf` | |
| - `smoke-r0/smoke-r0-Q4_K_M.gguf` | |
| - `smoke-r0/smoke-r0-Q8_0.gguf` | |