|
| 1 | +# r/LocalLLaMA submission |
| 2 | + |
| 3 | +r/LocalLLaMA audience: people running Llama / Mistral / Qwen on consumer |
| 4 | +GPUs locally, MCP-savvy, anti-cloud-bias, hate marketing speak, love |
| 5 | +numbers and code. The post below is tuned to that. |
| 6 | + |
| 7 | +Subreddit rules: self-promo OK if you provide real technical context and |
| 8 | +clearly mark yourself as the author. Don't pitch. |
| 9 | + |
| 10 | +## URL field |
| 11 | + |
| 12 | +Leave empty. Use the text-post format so the body is what people read. |
| 13 | + |
| 14 | +## Flair |
| 15 | + |
| 16 | +Pick **`Resources`** or **`New Model`** — whichever the subreddit has |
| 17 | +active. (`Discussion` second choice.) |
| 18 | + |
| 19 | +## Title |
| 20 | + |
| 21 | +``` |
| 22 | +I wanted my local LLM to control a $5 microcontroller safely. Built an open protocol for it. |
| 23 | +``` |
| 24 | + |
| 25 | +(~88 chars, within Reddit's 300-char limit. The "I wanted... built" framing |
| 26 | +is personal-narrative, which r/LocalLLaMA upvotes more than "Show:" / "I made:".) |
| 27 | + |
| 28 | +## Body (paste exactly) |
| 29 | + |
| 30 | +``` |
| 31 | +**TL;DR** — open protocol + Python bridge + ESP32 firmware so any |
| 32 | +MCP-compatible client (Ollama, LM Studio, Claude Desktop, llama.cpp + |
| 33 | +plugins, ...) can talk to a dollar-class microcontroller. 19-byte |
| 34 | +wire frames, ~14 KB firmware on ESP32, no cloud needed. MIT. |
| 35 | +
|
| 36 | +Repo: https://github.com/device-context-protocol/dcp |
| 37 | +
|
| 38 | +## Why I built this |
| 39 | +
|
| 40 | +I have a box running Llama 3.3 70B + a drawer of ESP32s. Wanted |
| 41 | +natural-language control without sending anything to a cloud API. |
| 42 | +Surveyed what existed: |
| 43 | +
|
| 44 | +- **Custom Python middleware per project** — every script reinvents |
| 45 | + framing, no schema, no safety, no interop. |
| 46 | +- **"ChatGPT controls Hue lights"** — cloud LLM + vendor lock-in, |
| 47 | + ignores the local LLM case entirely. |
| 48 | +- **IoT-MCP (arXiv:2510.01260)** — best academic attempt. But 74 KB |
| 49 | + peak memory excludes the cheap Cortex-M0+ class I actually have |
| 50 | + in bulk, and the underlying protocol is unchanged MCP, so it |
| 51 | + inherits JSON-RPC overhead. No safety primitives beyond MCP's |
| 52 | + defaults. |
| 53 | +
|
| 54 | +So I wrote a protocol with the constraints I actually have: |
| 55 | +local LLM, cheap hardware, no cloud, MCP-compatible. |
| 56 | +
|
| 57 | +## What's on the wire |
| 58 | +
|
| 59 | +``` |
| 60 | +LLM ── MCP ──▶ Bridge (asyncio) ── 19B wire frame ──▶ ESP32 |
| 61 | + │ |
| 62 | + ├─ capability token (HMAC-SHA256, scoped, expiring) |
| 63 | + ├─ range / type / unit check from manifest |
| 64 | + └─ dry-run as a wire-format bit (kind=0x81) |
| 65 | +``` |
| 66 | +
|
| 67 | +Wire frame: 6-byte fixed header + CBOR map + optional 16-byte HMAC. |
| 68 | +A `set_brightness(50)` call is 19 bytes. MCP JSON-RPC equivalent |
| 69 | +is ~180 bytes. The difference is the difference between "fits on a |
| 70 | +$5 chip" and "doesn't." |
| 71 | +
|
| 72 | +Bridge auto-translates MCP↔DCP. Tested with Claude Desktop, but the |
| 73 | +LLM side is just MCP — Ollama's MCP support, LM Studio's MCP |
| 74 | +extension, any other MCP host: all work zero-config. |
| 75 | +
|
| 76 | +## Numbers (measured, not target) |
| 77 | +
|
| 78 | +- **19 bytes** typical call frame, 35 with HMAC, 30 for CoAP-equivalent |
| 79 | +- **14 KB** pure DCP code over an empty Arduino-ESP32 sketch (full |
| 80 | + binary 294 KB including Arduino runtime + FreeRTOS) |
| 81 | +- **22.7 KB** global vars, leaves 305 KB for stack/heap |
| 82 | +- **88 / 88** Python unit + conformance tests green |
| 83 | +- **10 / 10** round-trip tests against real ESP32-WROOM-32 over UART |
| 84 | +- **5 transports** ship: loopback (test), UART (COBS+CRC), MQTT, |
| 85 | + BLE GATT, MCP-server-wrapper |
| 86 | +
|
| 87 | +## What's NOT done yet (honest) |
| 88 | +
|
| 89 | +- Only one MCU validated so far (ESP32-WROOM-32). T-Panel S3 + CAN |
| 90 | + bus port coming next 2 weeks. |
| 91 | +- No empirical A/B vs IoT-MCP yet — that's the follow-up paper. |
| 92 | +- Spec is **draft (v0.3)**. v1.0 freeze gated on a second-language |
| 93 | + port (community C or Rust would be amazing). |
| 94 | +- No demo video yet — firmware just landed working last week. Coming |
| 95 | + with the v0.4 T-Panel demo. |
| 96 | +
|
| 97 | +## Try it (10 minutes) |
| 98 | +
|
| 99 | +```bash |
| 100 | +pip install "pydcp[mcp,serial]" |
| 101 | +dcp serve examples/lamp_manifest.yaml --simulator |
| 102 | +# point your MCP client at the running `dcp` process |
| 103 | +# LLM sees: set_brightness / set_color / read_brightness tools |
| 104 | +``` |
| 105 | + |
| 106 | +Replace `--simulator` with `--serial COM5` (or `/dev/ttyUSB0`) once |
| 107 | +you flash an ESP32. Firmware source + Arduino library at |
| 108 | +`firmware/esp32/` in the repo. |
| 109 | + |
| 110 | +## What I want from this post |
| 111 | + |
| 112 | +If you have a local LLM + an ESP32 in a drawer: |
| 113 | + |
| 114 | +- Try it, tell me what MCP client you used and whether it worked |
| 115 | +- Tell me what primitive you wish the manifest schema had |
| 116 | +- Tell me what's wrong with the design (I'd much rather hear "your |
| 117 | + capability model is naive because X" than "great project!") |
| 118 | + |
| 119 | +Also: looking for a **cs.NI arXiv endorser** if anyone here has |
| 120 | +published in cs.NI in the last 3 years. |
| 121 | + |
| 122 | +## Links |
| 123 | + |
| 124 | +- **Repo + spec**: https://github.com/device-context-protocol/dcp (MIT) |
| 125 | +- **PyPI**: https://pypi.org/project/pydcp/ |
| 126 | +- **Paper draft** (12 pages, PDF): https://github.com/device-context-protocol/dcp/releases/download/v0.3.0/main.pdf |
| 127 | +- **Design rationale** (why not MCP / WoT / Matter / Sparkplug B / OpenAPI): docs/RATIONALE.md |
| 128 | +- **5-step "how to add a new intent"**: docs/ADDING_FEATURES.md |
| 129 | + |
| 130 | +Author here. Not posting on HN yet — my account is karma 1 and Show |
| 131 | +HN posts auto-hide. r/LocalLLaMA gets first read. |
| 132 | +``` |
| 133 | +
|
| 134 | +## Image to attach (optional but recommended) |
| 135 | +
|
| 136 | +Reddit lets you put one image in a text post. Use **arch.png** from |
| 137 | +the repo (`docs/paper/figures/arch.png`). Caption: "the architecture |
| 138 | +in one image". |
| 139 | +
|
| 140 | +## Timing |
| 141 | +
|
| 142 | +- **US morning** (8-11 AM EST / Mon-Thu) is when r/LocalLLaMA is most |
| 143 | + active in comments |
| 144 | +- Avoid weekends (vote slow, comments thin) |
| 145 | +- Avoid right after a big OpenAI / Anthropic / Mistral release |
| 146 | + announcement (gets buried) |
| 147 | +
|
| 148 | +## Reply tips |
| 149 | +
|
| 150 | +- **Disclose the relationship to MCP again in replies** — people will |
| 151 | + ask "isn't this just MCP?" Be specific: "MCP is the LLM-side, DCP |
| 152 | + is the wire-format-side. Bridge translates." |
| 153 | +- **Don't compare to LangChain / LlamaIndex** — wrong audience layer. |
| 154 | + This is below where those operate. |
| 155 | +- **If someone asks "but my LLM doesn't have MCP support"** — point |
| 156 | + them at https://github.com/punkpeye/awesome-mcp-clients |
| 157 | +- **If criticized for "yet another protocol"** — read `RATIONALE.md` |
| 158 | + out loud, don't argue |
| 159 | +- **If someone asks for benchmarks against direct UART text protocols** |
| 160 | + — say "honest answer, those win on raw throughput; DCP wins on |
| 161 | + schema, capability scoping, and dry-run. Different tradeoffs." |
| 162 | +
|
| 163 | +## Cross-posts (after r/LocalLLaMA, with 1-2 day gap) |
| 164 | +
|
| 165 | +- **r/embedded** — same content, different framing ("Open protocol for |
| 166 | + LLM-driven embedded systems") |
| 167 | +- **r/esp32** — focus on the ESP32 firmware + flash size |
| 168 | +- **r/Anthropic** — focus on MCP compatibility (smaller subreddit but |
| 169 | + responsive) |
| 170 | +- **r/RaspberryPi** — port to Pi (just use the Python Bridge; the |
| 171 | + Pi can host the Bridge for multiple ESP32 devices) |
0 commit comments