← Home ·Distributed network
Agent-first · P2P · Verified

The compute you leave unused
is the compute someone else needs.

Contribute compute → Earn credits → Generate code

Connect your local LLM as a worker. Earn Codoken Credits by processing code-generation tasks for other developers. Spend your credits to get code generated by the network, with execution verified in a sandbox.

⚡ Earn with your GPU →
Build with Codoken →

Local model? Apple Silicon, Nvidia, AMD, any Ollama-compatible setup. See compatible hardware →

Free code generation available now

Your idle GPU is a credit machine

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.

Start earning in 60 seconds
# 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
💻

Connect your LLM

Point the worker at any local model — Ollama, LM Studio, llama.cpp. It runs in the background and picks up generation tasks automatically. For best results: Qwen3 or DeepSeek V3 for reasoning-heavy tasks; Qwen Coder or DeepSeek Coder for fast, low-VRAM generation.

→
⚡

Earn while idle

Every approved generation earns 3 CU (Tier A · high effort), 1 CU (Tier B · standard), or 0.5 CU (Tier C · low effort). Tiers are set automatically by validator consensus — the harder your model worked, the more you earn.

→
🚀

Spend on verified code

Submit your own atoms. The network generates and verifies code for you — for free, funded entirely by your own contributions as a worker.

🔒

Sandboxed execution

Each task runs in an isolated subprocess. No test harnesses reach your worker — you only see the generation prompt, never the validation code.

🛡️

Resource capped

The worker script caps CPU and memory usage. Your machine keeps responding. Set a concurrency limit to control exactly how much compute you donate.

🔑

Auth-only connection

Workers connect via authenticated WebSocket to broker.codoken.dev. Your local model is never exposed — the broker is the only network endpoint.

📊

Quality scoring

Your approval rate is tracked. High-quality workers get first pick of the queue. Consistent rejecters are deprioritized — no penalty for selective generation.

Tier A · Best earnings

Apple Silicon

M1 / M2 / M3 / M4 — unified memory makes large context windows feasible. Runs Ollama natively. Quiet, efficient, always-on.

MacBook Pro · Mac mini · Mac Studio · Mac Pro
Recommended: Qwen3 14B · DeepSeek V3
Tier A · Best earnings

Nvidia RTX

RTX 3080 and above with 10 GB+ VRAM. Run 7B–13B models at full speed. CUDA-accelerated generation is the fastest option.

RTX 3080 · 3090 · 4070 · 4080 · 4090
Recommended: Qwen3 14B · DeepSeek V3 · DeepSeek Coder V2
Tier B · Good earnings

Mid-range GPU

RTX 3060 / RX 6700 or similar with 8 GB VRAM. Handles 7B models well. Earns steadily on simpler and standard-tier tasks.

RTX 3060 · 3070 · RX 6700 · RX 6800
Recommended: Qwen Coder 7B · DeepSeek Coder 6.7B
Tier C · Entry level

CPU-only / Home server

Any machine with 16 GB+ RAM can run 3B–7B models via llama.cpp. Slower generation but qualifies for lightweight tasks and validator role.

Any modern CPU · Raspberry Pi 5 (4B validator)
Recommended: Qwen Coder 3B · DeepSeek Coder 1.3B

One manifest, verified output

Every atom travels through a deterministic, trust-minimised pipeline before you see a line of code.

📝

Developer submits

You send a prompt + test harness via MCP tool, CLI, or WebSocket. Your test code is never shown to the worker.

→
🤖

Worker generates

A worker LLM node picks up the task from the queue and generates a solution from your prompt alone.

→
✅

Validators verify

A committee of isolated validators runs the generated code against your test harness. Consensus required.

→
⚡

Credits settle

APPROVED: credits transfer from developer to worker. REJECTED: worker earns nothing, only a minimal validator fee is deducted.

How credits work

Workers earn what developers spend — no markup, no platform cut. Every atom is priced automatically by the network based on the actual computational effort the worker invested: a task that pushed the worker's model hard earns more than one it handled easily. Tiers are set by validator consensus — you never declare one.

Tier B · standard effort
1 CU
typical generation load for this worker
Tier C · low effort
0.5 CU
worker handled it well within capacity
Tier A · high effort
3 CU
worker stretched to produce the result
Validator vote
0.01 CU
per consensus vote · earned regardless of outcome

Rejected atoms are charged only the validator fee (a fraction of a CU). Workers earn nothing on rejections — quality is incentivised from both sides.

Atomic development — the agent-first approach

Stop asking AI to write whole files. Decompose software into atoms: small, self-contained, independently verifiable units. Let agents orchestrate. Let Codoken verify.

Principle 1

One atom, one function

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.

Principle 2

Tests as the spec

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.

Principle 3

Agent orchestrates, network executes

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.

Principle 4

Fail fast, fail cheaply

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'"}
    }
  ]
}

One account, three ways to participate

Earn credits by contributing compute or validation. Spend them to generate verified code. Switch roles any time — same account, same balance. Run multiple machines under the same account: earn on your GPU workstation, spend from your laptop.

🤖 Worker

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 atom (Tier C / B / A)

🔬 Validator

Run 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 vote

👨‍💻 Developer

Submit 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 atom (Tier C / B / A)

Need to route tasks to a specific colleague's powerful model — not the anonymous public network? Trusted Peers on the home page → lets you share inference privately between people you know, with automatic token settlement.

───────────────────────────────────────────────── -->

Up and running in 2 minutes

Clone the repo and run the setup wizard. It handles auth, LLM detection, container engine, config, and optional background service install — interactively.

One-time setup
# 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())

Why We Built Codoken

We had powerful machines sitting idle for hours, yet when our AI coding agents needed more compute, we were still relying on commercial APIs, facing rising costs and usage limits. We started wondering: what if developers could help each other instead?

That question became Codoken.

We envisioned a network where developers contribute their idle local compute to execute small, independent code-generation tasks for others, earning credits they can use when they need computing power themselves. Instead of leaving resources unused or relying entirely on centralized providers, we could put them to work together.

But sharing compute means trusting software you didn't write to run on your machine. We believe that trust must be earned, not assumed. That's why we built Codoken around transparent tooling and sandboxed execution, giving contributors the ability to inspect how tasks run on their hardware.

Codoken was born from a simple idea: the compute we leave unused could become the compute someone else needs.

Common questions

How is Codoken different from just calling an LLM API directly?

A direct LLM call returns text. Codoken returns verified code. Every atom is paired with a test harness that runs inside a sandboxed container after generation — the token payment only settles if execution passes. You're not paying for tokens; you're paying for deterministic, tested output.

What is an atom?

An atom is a small, self-contained coding task: a function, a module, a test suite. It combines a natural-language prompt with a validator payload — the test harness that proves the generated code actually works. Atoms are the primitive unit of work in Codoken.

Do I need a powerful GPU to participate?

No. Workers need a locally running LLM (Ollama, LM Studio, or llama.cpp) — any Apple Silicon Mac, Nvidia GPU, or AMD GPU that can run a quantised model qualifies. Lightweight models like Qwen Coder 7B or DeepSeek Coder 6.7B run well on 8 GB VRAM and earn steadily on standard tasks. Reasoning-capable models like Qwen3 14B or DeepSeek V3 unlock complex-tier earnings on higher-end hardware. Validators need Docker or Podman to run sandboxed containers, which works on almost any machine. Developers need neither — just credits.

What stops a worker from submitting garbage to collect credits?

Nothing settles until an independent validator committee runs the code inside a sandboxed container and confirms it passes the test harness. Workers are only paid on approved atoms. Repeated rejections reduce a worker's quality score and deprioritise them in dispatch.

Can I use Codoken inside Claude Code or Cursor?

Yes. Codoken ships an MCP server (codoken_mcp.py) that exposes submit_atom and get_result as tools. Your agent calls them like any other tool — Codoken handles dispatch, validation, and settlement transparently.

What languages are supported?

Python, JavaScript, TypeScript, Go, Rust, Java, C++, PHP, and Ruby — each backed by a dedicated runtime container. GDScript for Godot 4 and GDScript 3 (Godot 3.6.2) are also supported, with code executed in a real headless Godot process. See the GDScript page for Godot-specific examples.

Can Codoken generate GDScript for Godot?

Yes. Codoken supports GDScript for both Godot 4 (version 4.3) and Godot 3 (version 3.6.2). Generated code is verified inside a real headless Godot process — not simulated. The atomic pattern is a natural fit for game logic: write a pure function for movement, damage, or pathfinding, pair it with assert-based tests, and get back verified GDScript ready to paste into your scene script.

How does the atomic pattern work for Godot game development?

The key is keeping each atom pure: no Node references, no @onready, no scene tree. Describe a single game-logic function — a knockback formula, a loot table roll, an angle interpolation — with its typed signature and edge cases. The validator runs your assert tests inside headless Godot. Once approved, you paste the verified function into any script that needs it. Scene-specific wiring stays with you; Codoken handles the logic layer.

Which local models work best as Codoken workers?

For complex-tier tasks requiring strong reasoning, Qwen3 14B and DeepSeek V3 produce the highest approval rates — they follow structured prompts reliably and handle multi-step logic well. For fast generation on standard tasks with limited VRAM, Qwen Coder 7B and DeepSeek Coder 6.7B are ideal (8 GB VRAM). On CPU-only machines, Qwen Coder 3B and DeepSeek Coder 1.3B handle lightweight tasks. All connect via Ollama, LM Studio, or llama.cpp.

Is my code sent to a third-party cloud?

No. Code is routed peer-to-peer between connected nodes via the Codoken broker. It is never stored permanently or sent to any external cloud AI service. Workers run inference entirely locally on their own hardware.

Can I share my local LLM with a colleague and get paid for it?

Yes — that's what Trusted Peers is for. You invite a specific developer, they accept, and their inference requests route directly to your machine via an OpenAI-compatible endpoint. Every task settles automatically via the Codoken token ledger: the developer is debited, you are credited by the exact token count. No broker cut, no manual invoicing, no cloud API. Your machine shows up in their tool's model dropdown — they just pick your name and generate.

Can I run several machines with the same account?

Yes. You can connect as many machines as you want under the same Codoken account. Each device runs independently — a powerful workstation earns credits as a worker while your laptop spends them to generate code. Credits are shared across all your devices in a single balance.

For GPU owners

Start earning credits

Connect your local LLM. Earn CU for every approved generation while your machine is idle.

⚡ Set up your worker →
For developers

Ship verified code

Sign up with your email. Get 100 free credits. Submit atoms via MCP in Claude Code or Cursor.

Get started free →