Synoema

Synoema + Ollama

Run fine-tuned Synoema code-generation models locally — no API key, no internet after download

Available Models

synoema-coder-3b-v3 ↗

1.8 GB Q4_K_M 70.2% run_pass

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 ↗

4.4 GB Q4_K_M 71.2% run_pass

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 ↗

IoT rules 97.1% compile_pass

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 ↗

IoT rules 99.0% compile_pass

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

  1. Install Ollama
    curl -fsSL https://ollama.com/install.sh | sh  # Linux / macOS
    # Windows: https://ollama.com/download
  2. 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 Modelfile
    Important: always use a Modelfile with the system prompt. Without it the model may output explanations instead of code.
  3. Generate code
    ollama run synoema-coder-3b "Sort a list using quicksort"
    Output:
    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]
  4. 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 promptWhat you get
Filter even numbers from [1..20] and sum themCorrect Synoema one-liner
Define a recursive fibonacci functionIdiomatic let fib n = ...
Turn on fan when temperature exceeds 30IoT rule (use iot model)
Safe division with requires/ensures contractFunction 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

IoT Platform documentation

Performance

ModelHardwareTokens/sec
3B Q4_K_MM2 MacBook Air (CPU)~30 t/s
3B Q4_K_MAMD RX 7900 GRE (GPU, ROCm)~120 t/s
7B Q4_K_MM2 MacBook Air (CPU)~15 t/s
7B Q4_K_MAMD RX 7900 GRE (GPU, ROCm)~60 t/s

Troubleshooting

ProblemFix
Model outputs English text instead of codeSystem prompt was not applied — use a Modelfile (step 2 above)
sno check fails on generated codeAdd "temperature": 0 to generation options
Out of memory on 7BUse 3B model, or: ollama run --ctx-size 2048 synoema-coder-7b
Slow generation on CPUSet 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.