Connect your local LLM as a worker. Earn Codoken Credits while it runs in the background. Spend them to get AI-generated code validated by the same network.
Local model? Apple Silicon, Nvidia, AMD, any Ollama-compatible setup. See compatible hardware →
Run your local LLM as a Codoken worker while you sleep. Earn credits for every approved generation — spend them to get verified code for your own projects.
# 1. Clone git clone https://github.com/poulpeck/codoken-client cd codoken-client # 2. (Recommended on macOS) Create a virtual environment python3 -m venv venv && source venv/bin/activate # 3. Install dependencies then run the setup wizard pip install -r requirements.txt python codoken_setup.py
Point the worker at any local model — Ollama, LM Studio, llama.cpp. It runs in the background and picks up generation tasks automatically.
Every approved generation earns 1 CU (standard function), 0.5 CU (simple), or 3 CU (complex). Quality matters — better approval rates get better queue priority.
Submit your own atoms. The network generates and verifies code for you — for free, funded entirely by your own contributions as a worker.
Each task runs in an isolated subprocess. No test harnesses reach your worker — you only see the generation prompt, never the validation code.
The worker script caps CPU and memory usage. Your machine keeps responding. Set a concurrency limit to control exactly how much compute you donate.
Workers connect via authenticated WebSocket to broker.codoken.dev. Your local model is never exposed — the broker is the only network endpoint.
Your approval rate is tracked. High-quality workers get first pick of the queue. Consistent rejecters are deprioritized — no penalty for selective generation.
M1 / M2 / M3 / M4 — unified memory makes large context windows feasible. Runs Ollama natively. Quiet, efficient, always-on.
RTX 3080 and above with 10 GB+ VRAM. Run 7B–13B models at full speed. CUDA-accelerated generation is the fastest option.
RTX 3060 / RX 6700 or similar with 8 GB VRAM. Handles 7B models well. Earns steadily on simpler and standard-tier tasks.
Any machine with 16 GB+ RAM can run 3B–7B models via llama.cpp. Slower generation but qualifies for lightweight tasks and validator role.
Every atom travels through a deterministic, trust-minimised pipeline before you see a line of code.
You send a prompt + test harness via MCP tool, CLI, or WebSocket. Your test code is never shown to the worker.
A worker LLM node picks up the task from the queue and generates a solution from your prompt alone.
A committee of isolated validators runs the generated code against your test harness. Consensus required.
APPROVED: you pay, worker earns. REJECTED: worker earns nothing, you pay only the minimal validator fee.
Workers earn the same amount developers spend. Tiers are set automatically by validator consensus — you never need to declare one. Rejected atoms cost only a fraction of a CU.
Rejected atoms are charged only the validator fee (a fraction of a CU). Workers earn nothing on rejections — quality is incentivized from both sides.
Stop asking AI to write whole files. Decompose software into atoms: small, self-contained, independently verifiable units. Let agents orchestrate. Let Codoken verify.
Each atom defines exactly one function or class with a precise contract. Small scope means predictable generation, fast validation, and composable output. Three similar lines beat a premature abstraction.
Your test harness is the source of truth — not a comment, not a docstring. The test travels separately from the prompt so workers cannot hardcode outputs. If the tests pass, the contract is fulfilled.
Your AI agent (Claude Code, Cursor, custom) decomposes a feature into atoms, submits them in parallel via the MCP tools, and assembles verified code. The agent decides what to build; Codoken proves it works.
Rejection costs only the validator fee (fractions of a CU). Retry with an improved prompt. A rejected atom is a fast, cheap signal that your spec was underspecified — caught before it reaches your codebase.
# Claude Code / any MCP-capable agent # 1. Agent decomposes feature into atoms and submits in parallel result = submit_manifest( task_id="string_utils_v1", language="python", atoms=[ {"id": "reverse", "prompt": "reverse_string(s) -> str", "test_code": "..."}, {"id": "slugify", "prompt": "slugify(s) -> str", "test_code": "..."}, {"id": "truncate", "prompt": "truncate(s, n) -> str", "test_code": "..."}, ] ) # All atoms run in parallel. APPROVED only if every atom passes. # 2. Agent assembles verified code into the target module.
# manifests/string_utils.json — version-controlled atom spec { "version": "1.0", "environment": {"language": "python"}, "atoms": [ { "id": "reverse_string", "worker_payload": {"prompt": "Write reverse_string(s: str) -> str ..."}, "validator_payload": {"test_code": "assert reverse_string('hi') == 'ih'"} } ] }
Earn credits by contributing compute or validation. Spend them to generate verified code. Switch roles any time — same account, same balance.
Connect any local LLM — Ollama, LM Studio, llama.cpp. It runs in the background, picks up tasks, generates code, and earns credits for every approved solution. Quality matters: better approval rates get better queue priority.
+0.5 / +1 / +3 CU per approved atomRun a lightweight sandboxed container. Execute generated code against test harnesses, vote on verdicts. Low compute requirement — even a modest machine qualifies. Every consensus agreement earns a micro-reward.
+0.005 / +0.01 / +0.03 CU per voteSubmit atoms via MCP (Claude Code, Cursor), CLI, or WebSocket. Get back verified code that passes your tests — generated by the network, funded by your own contributions if you run a worker or validator.
−0.5 / −1 / −3 CU per atomClone the repo and run the setup wizard. It handles auth, LLM detection, container engine, config, and optional background service install — interactively.
# 1. Clone git clone https://github.com/poulpeck/codoken-client cd codoken-client # 2. (Recommended on macOS) Create a virtual environment python3 -m venv venv && source venv/bin/activate # 3. Install dependencies then run the setup wizard pip install -r requirements.txt python codoken_setup.py # The wizard will: # - Ask which role(s) to run: worker / validator / both # - Sign in or create your Codoken account # - Auto-detect your local LLM (Ollama, LM Studio, llama.cpp) # - Auto-detect Docker / Podman for the validator # - Write ~/.codoken/config.json # - Optionally install a background service (launchd / systemd)
# Run the doctor to verify everything is working python codoken_setup.py check # Manage the background service python codoken_setup.py service install # auto-start on login (launchd / systemd) python codoken_setup.py service uninstall # Tail live logs python codoken_setup.py logs # all roles python codoken_setup.py logs worker # worker only python codoken_setup.py logs --lines 0 # follow mode (ctrl+c to exit)
# Add to ~/.claude/settings.json after codoken_setup.py completes { "mcpServers": { "codoken": { "command": "python", "args": ["/path/to/codoken/codoken_mcp.py"], "env": { "CODOKEN_AUTH": "firebase", "CODOKEN_AUTH_STORE": "~/.codoken/auth.json" } } } } # In Claude Code, submit your first atom submit_atom(task_id="hello", language="python", prompt="Write add(a,b) -> int", test_code="assert add(2,3)==5")
# Connect as developer and submit a manifest directly import asyncio, json, websockets async def submit(): async with websockets.connect( "wss://broker.codoken.dev/ws/developer", additional_headers={"Authorization": "Bearer <firebase-id-token>"} ) as ws: await ws.send(json.dumps({ "action": "submit_manifest", "task_id": "hello", "manifest": { "version": "1.0", "environment": {"language": "python"}, "worker_payload": {"prompt": "Write add(a,b)->int"}, "validator_payload": {"test_code": "assert add(2,3)==5"} } })) print(await ws.recv()) asyncio.run(submit())