Synoema + Ollama
Run fine-tuned Synoema code-generation models locally — no API key, no internet after download
Available Models
synoema-coder-3b-v3 ↗
General Synoema code generation. Best balance of size and accuracy. Runs on any modern laptop.
ollama run hf.co/delimitter/synoema-coder-3b-v3:Q4_K_M
synoema-coder-7b-v1 ↗
Higher accuracy on complex tasks: recursion, ADT pattern matching, contracts. Requires 8 GB RAM.
ollama run hf.co/delimitter/synoema-coder-7b-v1:Q4_K_M
synoema-iot-lite-1.5b-v2 ↗
Specialised for IoT automation rules: GPIO, sensors, thresholds, hysteresis. Compiles to ~82 B WASM.
ollama run hf.co/delimitter/synoema-iot-lite-1.5b-v2:Q4_K_M
synoema-iot-mid-3b-v1 ↗
Best IoT rule accuracy. Industrial-grade contracts (requires/ensures) supported.
ollama run hf.co/delimitter/synoema-iot-mid-3b-v1:Q4_K_M
Quick Start
-
Install Ollama
curl -fsSL https://ollama.com/install.sh | sh # Linux / macOS # Windows: https://ollama.com/download -
Create a model with the system prompt
cat > Modelfile << 'EOF' FROM hf.co/delimitter/synoema-coder-3b-v3:Q4_K_M SYSTEM "You are a Synoema code generator. Output only valid Synoema source code, no explanation." EOF ollama create synoema-coder-3b -f ModelfileImportant: always use a Modelfile with the system prompt. Without it the model may output explanations instead of code. -
Generate code
Output:ollama run synoema-coder-3b "Sort a list using quicksort"let quicksort xs = case xs of [] -> [] (p:rest) -> let smaller = filter (\x -> x <= p) rest larger = filter (\x -> x > p) rest in quicksort smaller ++ [p] ++ quicksort larger quicksort [5, 3, 8, 1, 9, 2] -
Verify with Synoema
ollama run synoema-coder-3b "Compute GCD of 48 and 18" > result.sno sno check result.sno # typecheck sno run result.sno # run → 6
Prompting Tips
These models are code generators, not chatbots. Give direct task descriptions:
| Good prompt | What you get |
|---|---|
Filter even numbers from [1..20] and sum them | Correct Synoema one-liner |
Define a recursive fibonacci function | Idiomatic let fib n = ... |
Turn on fan when temperature exceeds 30 | IoT rule (use iot model) |
Safe division with requires/ensures contract | Function with formal contracts |
Always use temperature 0 for deterministic output. The models were evaluated at greedy decoding.
REST API
curl http://localhost:11434/api/generate \
-d '{
"model": "synoema-coder-3b",
"prompt": "Filter odd numbers from [1..20] and compute their sum",
"stream": false,
"options": { "temperature": 0, "num_predict": 256 }
}' | jq -r '.response'
Python
import ollama, subprocess, tempfile, os
def generate_and_verify(prompt: str, model: str = "synoema-coder-3b") -> tuple[str, bool]:
code = ollama.generate(
model=model,
prompt=prompt,
options={"temperature": 0},
)["response"]
with tempfile.NamedTemporaryFile(suffix=".sno", mode="w", delete=False) as f:
f.write(code); fname = f.name
ok = subprocess.run(["sno", "run", fname], capture_output=True).returncode == 0
os.unlink(fname)
return code, ok
code, passed = generate_and_verify("Compute factorial of 10 using recursion")
print(code)
print("✅ passes" if passed else "❌ fails")
IoT Rules via Ollama
ollama run hf.co/delimitter/synoema-iot-mid-3b-v1:Q4_K_M \
"Trigger alarm when pressure exceeds 5 bar, requires sensor.pressure >= 0"
Output:
rule pressure_alarm
requires \sensor -> sensor.pressure >= 0
when pressure > 5
then gpio_write 5 1
Compile and deploy:
sno wasm rule.sno -o rule.wasm # → ~90 bytes
# Copy to Raspberry Pi / ESP32 and run with wasm3
Performance
| Model | Hardware | Tokens/sec |
|---|---|---|
| 3B Q4_K_M | M2 MacBook Air (CPU) | ~30 t/s |
| 3B Q4_K_M | AMD RX 7900 GRE (GPU, ROCm) | ~120 t/s |
| 7B Q4_K_M | M2 MacBook Air (CPU) | ~15 t/s |
| 7B Q4_K_M | AMD RX 7900 GRE (GPU, ROCm) | ~60 t/s |
Troubleshooting
| Problem | Fix |
|---|---|
| Model outputs English text instead of code | System prompt was not applied — use a Modelfile (step 2 above) |
sno check fails on generated code | Add "temperature": 0 to generation options |
| Out of memory on 7B | Use 3B model, or: ollama run --ctx-size 2048 synoema-coder-7b |
| Slow generation on CPU | Set OLLAMA_NUM_GPU=1 if you have a GPU |
See Also
User Guide →
Step-by-step introduction including Ollama quickstart.
MCP + RAG →
Session-persistent generation with full dev intelligence tools.
IoT Platform →
Deploy generated rules to MCU, ESP32, Raspberry Pi.
HuggingFace ↗
All Synoema fine-tuned models — GGUF, adapters, model cards.