MCPcopy Index your code
hub / github.com/evilsocket/cake

github.com/evilsocket/cake @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
2,645 symbols 7,174 edges 223 files 472 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

cake

Documentation Release Rust Report CI License

Cake is a multimodal AI inference server written in Rust that can run models as a single node, or shard them across a heterogeneous cluster of devices — iOS, Android, macOS, Linux, Windows — to run workloads that wouldn't fit on a single GPU, effectively leveraging planned obsolescence to make AI more accessible and democratic.

This is experimental code that's being actively developed and changed very quickly.

Key Features

Quick Start

Build

cargo build --release --features cuda        # Linux (NVIDIA)
cargo build --release --features metal       # macOS (Apple Silicon GPU)
cargo build --release --features accelerate  # macOS (Apple Silicon CPU, F32 models)
cargo build --release --features vulkan      # Linux (AMD/Intel/Steam Deck)
cargo build --release                        # CPU only (portable)

Models

Download models from HuggingFace with cake pull. Models are stored in the standard HuggingFace cache directory (~/.cache/huggingface/hub/) and are shared with any other tools that use the same cache (transformers, huggingface-cli, etc.).

cake pull evilsocket/Qwen3-0.6B             # text model (600M params)
cake pull evilsocket/flux1-dev               # image model (FLUX.1-dev FP8)
cake pull evilsocket/VibeVoice-1.5B          # voice synthesis model

cake list                                    # show all locally available models
cake rm evilsocket/Qwen3-0.6B               # delete a cached model

Models are also downloaded automatically on first use if not already cached.

Single Node

Run any model locally on a single machine — architecture is auto-detected from the model's config.json:

# Text generation
cake run evilsocket/Qwen3-0.6B "Explain quantum computing in simple terms"

# Interactive TUI chat
cake chat Qwen/Qwen3-0.6B

# Start an API server + web UI
cake serve evilsocket/Qwen3-0.6B

# Image generation (FLUX.1-dev FP8)
cake run evilsocket/flux1-dev --model-type image-model --image-model-arch flux1 \
  "a cyberpunk cityscape at night"

# Voice synthesis with voice cloning
cake run evilsocket/VibeVoice-1.5B --model-type audio-model \
  --voice-prompt voice.wav "Hello world"

Distributed

Shard a model across multiple machines using --cluster-key. Workers don't need the model data — the master automatically streams the required tensor weights over the network (compressed with zstd, verified with CRC32 checksums). Workers cache received data locally for subsequent runs.

# Start workers on any machines (no model needed)
cake run --cluster-key mysecret --name gpu-server-1    # machine A
cake run --cluster-key mysecret --name macbook          # machine B

# Run inference from the master (has the model)
cake run evilsocket/Qwen3-0.6B "Hello" --cluster-key mysecret

# Or start an API server as the master
cake serve evilsocket/Qwen3-0.6B --cluster-key mysecret

The master discovers workers via mDNS, assigns layers proportionally to each device's VRAM/compute, and pushes only the required weight shards. See the clustering documentation for manual topology files and advanced configuration.

For the full usage guide and API reference, check the project documentation.

Star History

Star History Chart

License

Released under the FAIR License (Free for Attribution and Individual Rights) v1.0.0.

  • Non-commercial use (personal, educational, research, non-profit) is freely permitted under the terms of the license.
  • Commercial use (SaaS, paid apps, any monetization) requires visible attribution to the project and its author. See the license for details.
  • Business use (any use by or on behalf of a business entity) requires a signed commercial agreement with the author. Contact evilsocket@gmail.com for inquiries.

To see the licenses of the project dependencies, install cargo license with cargo install cargo-license and then run cargo license.

Extension points exported contracts — how you extend this code

ComputeBackend (Interface)
Abstraction over compute backends (CPU, CUDA, Metal, Vulkan). Each method has a CPU-based default via [`CpuBackend`]. G [5 …
cake-core/src/backends/mod.rs
Forwarder (Interface)
(no doc) [21 implementers]
cake-core/src/cake/mod.rs
Generator (Interface)
(no doc) [21 implementers]
cake-core/src/models/mod.rs
TextGenerator (Interface)
(no doc) [14 implementers]
cake-core/src/models/mod.rs
Quantization (Interface)
A quantization strategy that can create a VarBuilder with appropriate dequantization and estimate in-memory VRAM from on [3 …
cake-core/src/utils/mod.rs

Core symbols most depended-on inside this repo

clone
called by 288
cake-core/src/utils/fp8.rs
clone
called by 269
cake-core/src/models/common/disk_expert_provider.rs
get
called by 219
cake-core/src/models/sd/sd.rs
dtype
called by 188
cake-core/src/utils/split.rs
push
called by 180
cake-core/src/models/phi4/history.rs
make_tensor
called by 162
cake-core/benches/bench_helpers.rs
shape
called by 121
cake-core/src/utils/split.rs
forward
called by 85
cake-core/src/utils/fp8.rs

Shape

Function 1,471
Method 849
Class 291
Enum 22
Interface 12

Languages

Rust98%
Kotlin2%
Python1%

Modules by API surface

cake-core/src/cake/sharding/discovery.rs92 symbols
cake-core/src/backends/metal/mod.rs63 symbols
cake-core/src/models/sd/sd.rs58 symbols
cake-core/src/cake/sharding/proto/message.rs58 symbols
cake-core/src/cake/sharding/default.rs57 symbols
cake-core/src/backends/vulkan/mod.rs51 symbols
cake-core/src/models/flux/flux1_model.rs50 symbols
cake-core/tests/unit_tests/test_backend_ops.rs46 symbols
cake-core/src/backends/cpu/mod.rs44 symbols
cake-core/src/utils/tensor_storage.rs43 symbols
cake-core/tests/unit_tests/test_blocks.rs42 symbols
cake-core/src/models/common/text_model.rs40 symbols

For agents

$ claude mcp add cake \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact