2026-11-26 15:47 UTC

Enki Runtime claims its pure-Rust LLM runtime with live GPU/CPU brain migration becomes a practical substrate for local agent inference that can dynamically shift compute between devices mid-generation.

state: seedheat: lowuncertainty: highrust-llm-runtime live-model-migration local-inference-infrastructureEnki Runtime

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 1575h
points/hour across evidence Β· reading as of 2026-11-27 02:23:58.509736+11:00 Β· deterministic, not a model opinion

How the heat travelled

09-22 00:43⭐ origin echo-reconstructedThe current post (2026-10-13) is a Show HN for a demo repo, enki_llm, whose README says it "is built directly on top of the Enki runtime" an
enkiruntime (org; same person posts on HN as user "enki_runtime") on github (echo) Β· attributed from hn.story.50079754
β€”
10-13 22:23first on hacker news Β· published Β· +525.7hShow HN: Enki LLM A pure rust (even kernels) with live GPU/CPU brain migration
enki_runtime
β€”
10-13 22:23amplified on hacker news πŸ‘‘hn.story.50079754
enki_runtime
peak 3 Β· 0 comments Β· 59% of case engagement
10-14 12:56amplified on hacker newshn.story.50087016
enki_runtime
peak 2 Β· 0 comments Β· 41% of case engagement
10-13 23:21our radar first saw it Β· +526.6hdiscovery anchor: hn.story.50079754β€”

Evidence (3) β€” ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: Enki LLM A pure rust (even kernels) with live GPU/CPU brain migration
Retrieved article excerpt

Open article Β· Retrieved 2026-10-13T23:23:30.220117+00:00

# Enki LLM: Llama-3.2 1B in Pure Rust (Zero CUDA Dependencies)

[Open In Colab](https://colab.research.google.com/github/enkiruntime/enki_llm/blob/main/demo.ipynb)

A pure Rust Transformer inference engine (~2,000 LOC) running **Llama-3.2 1B** at **~40 tok/s** on an Nvidia Tesla T4 GPU, with **live brain migration** between GPU VRAM and CPU RAM mid generation.

---

## Live Demo: Brain Migration (GPU to CPU)

[Enki LLM Live Brain Migration Demo](https://github.com/enkiruntime/enki_llm/blob/main/assets/demo.gif)

> The session begins generating Python code on the **GPU** (white text), switches live via `/dual` mode (320ms migration), and continues streaming the explanation by alternating tokens between the **GPU** (white) and **Host CPU cores** (bold red) while `btop` tracks the CPU spikes.

---

## What It Does

- **High-Performance Pure-Rust Inference:** Runs unquantized F16 weights with FP32 accumulators at ~40 tokens/sec on Nvidia Tesla T4.
- **Live Brain Migration (GPU/CPU):** Seamlessly hot-swaps active execution and mirrors KV-cache between GPU VRAM and CPU RAM mid-sentence without losing context.
- **Cross-Silicon Portability:** The exact same binary runs on discrete GPUs (Nvidia), integrated graphics (Intel UHD), and multi-core CPUs without modifying a single line of code.
- **Minimalist Implementation (~2,000 LOC):** Everything, Safetensors parser, Tokenizer, Split-K GEMV, RoPE, RMSNorm, SwiGLU, and generation samplingβ€”is built from scratch in pure Rust.

---

## How It Is Built With Enki

Traditional Rust GPU tools either wrap CUDA/C++ or transpile syntax into WGSL. This project is built directly on top of the **[Enki](https://github.com/enkiruntime/enki)** runtime:

1. **Idiomatic Rust Kernels:** Compute passes are authored as regular Rust functions marked with the `#[nam]` attribute.
2. **Direct LLVM-to-SPIR-V JIT:** Enki's compiler (**Parsu**) ingests the standard LLVM bitcode generated by `rustc` (`--emit=llvm-bc`) and compiles it directly into SPIR-V compute shaders at runtime.
3. **Hardware Dispatch via Vulkan 1.3:** Execution runs natively on the hardware via Vulkan 1.3 using 64-bit Buffer Device Addresses (BDA) for pointer-like memory ergonomics on the GPU.
4. **Host Fallback:** When migrated to CPU, the same kernels execute natively in parallel across all CPU cores using Rayon.

---

## Try It (One-Click Google Colab)

Click the badge above or use this link:
**[Open in Google Colab (Free T4 GPU)](https://colab.research.google.com/github/enkiruntime/enki_llm/blob/main/demo.ipynb)**

Once open, simply click **Run all**. The notebook will prepare the environment, write the pure-Rust source files, build the release binary, and launch the interactive shell directly in your browser.

---

## Console Commands

During generation, you can control the engine in real time:

- `/gpu` β€” Migrate active execution and KV-cache to GPU Silicon.
- `/cpu` β€” Migrate active execution to Host CPU cores (Rayon).
- `/dual` β€” Ping-pong mode (alternates tokens between GPU and CPU live).
- `/reset` β€” Clear conversation memory and reset KV-cache.
- `exit` β€” Exit the session.

---

## Running Locally

Requirements: Vulkan 1.3 drivers and a standard Rust toolchain.

```
# Clone the repository
git clone https://github.com/enkiruntime/enki_llm.git
cd enki_llm

# Run with SmolLM2-135-Instruct
cargo run --release HuggingFaceTB/SmolLM2-135M-Instruct

# Or:
# Run with Llama-3.2-1B-Instruct
# cargo run --release unsloth/Llama-3.2-1B-Instruct
```

---

## Links

- **Core Runtime:** [Enki Heterogeneous Compute Platform](https://github.com/enkiruntime/enki)
enki_runtime30
🟧 echo.github ⭐The current post (2026-10-13) is a Show HN for a demo repo, enki_llm, whose README says it "is built directly on top of the Enki runtime" anenkiruntime (org; same person posts on HN as user "enki_runtime")β€”β€”
🟧 hnA pure Rust LLM engine (~2k LOC) with live GPU/CPU brain migrationenki_runtime20

Interpretation history

Decision trace