neuron-explorer
Qwen3.5‑4B 전용 조향형 뉴런 탐색기, 모든 MLP 뉴런을 밀어 결과를 보관·탐색
BitTorrent for LLMs — peer-to-peer distributed inference
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
OpenHydra
Run AI in a herd, not a data center.
A peer-to-peer protocol for free, distributed AI inference.
OpenHydra is a peer-to-peer protocol for distributed AI inference. It does not
run a model itself. Instead it sits in front of whatever inference engine you
already run — Ollama, vLLM, LM Studio, llama.cpp, or any OpenAI-compatible
server — and joins a global swarm that routes each request to a peer that has
the requested model, streams the completion back, and settles a co-signed
receipt. No central server. No API keys. No subscription. Think BitTorrent, for
AI inference.README 전문 보기 ↗OpenHydra is a peer-to-peer protocol for distributed AI inference. It does not run a model itself. Instead it sits in front of whatever inference engine you already run — Ollama, vLLM, LM Studio, llama.cpp, or any OpenAI-compatible server — and joins a global swarm that routes each request to a peer that has the requested model, streams the completion back, and settles a co-signed receipt. No central server. No API keys. No subscription. Think BitTorrent, for AI inference.
The whole thing is a single Rust binary, openhydra-agent. There is no Python
in any role.
Why OpenHydra?
Two roles, one binary:
provide — joins the swarm, detects the models your local engine serves,
advertises their canonical ids on the DHT, and serves inbound inference by
proxying to that engine. It never runs a model itself.serve — the consumer front door: an OpenAI-compatible HTTP/SSE gateway.
For each request it discovers a provider for the requested model, streams the
completion back over libp2p, and settles a co-signed receipt at EOS.A request never touches a coordinator: the gateway talks to the provider directly (or through a relay when both sides are NAT'd). Throughput is your engine's native speed plus the routing/transport overhead.
To share an engine you need an inference engine running locally (Ollama, vLLM, LM Studio, or llama.cpp). To only consume from the network, no engine is required.
One line, no toolchain — installs the latest openhydra-agent for your platform:
curl -fsSL https://openhydra.co/install.sh | sh
It drops the binary in /usr/local/bin (or ~/.local/bin if that isn't
writable). Prefer to grab it yourself? Download the right asset from the
latest release,
chmod +x, and put it on your PATH:
| Platform | Asset |
|---|---|
| macOS (Apple Silicon) | openhydra-agent-aarch64-apple-darwin |
| Linux (x86-64) | openhydra-agent-x86_64-unknown-linux-gnu |
| Windows (x86-64) | openhydra-agent-x86_64-pc-windows-msvc.exe |
The binaries are not yet code-signed. On macOS, if Gatekeeper blocks the binary,
clear the quarantine flag: xattr -d com.apple.quarantine ./openhydra-agent.
(Intel Macs and Linux arm64 have no prebuilt binary yet — build from source.)
Prefer a GUI? Grab the installer for your OS from the
latest release —
.dmg (macOS), -setup.exe / .msi (Windows), .AppImage / .deb (Linux) —
or use the one-click links at openhydra.co.
Needs a stable Rust toolchain. The whole workspace is pure Rust — no Python toolchain is required.
git clone https://github.com/samtroberts/openhydra && cd openhydra
cargo build --release -p openhydra-agent
# → ./target/release/openhydra-agent
Start your engine, then point a provider at it. Ollama is the default:
# Ollama on its standard port (11434)
./target/release/openhydra-agent provide --engine-kind ollama
# vLLM / LM Studio / llama.cpp / any OpenAI-compatible server
./target/release/openhydra-agent provide --engine-kind vllm --engine http://127.0.0.1:8000
./target/release/openhydra-agent provide --engine-kind lm-studio --engine http://127.0.0.1:1234
./target/release/openhydra-agent provide --engine-kind llama-cpp --engine http://127.0.0.1:8080
./target/release/openhydra-agent provide --engine-kind openai --engine http://127.0.0.1:8000
# Exo MLX cluster (port 52415)
./target/release/openhydra-agent provide --engine-kind exo --engine http://127.0.0.1:52415
# ComfyUI for image / audio / video (port 8188); add --comfyui-workflow-dir <dir> for BYO workflows
./target/release/openhydra-agent provide --engine-kind comfyui --engine http://127.0.0.1:8188
Useful flags: --db <path> persists the receipt ledger (redb) across restarts;
--bootstrap <multiaddr> dials a known peer/relay when mDNS can't reach the
swarm; --reannounce-secs tunes the DHT re-announce interval (default 120s).
Run the OpenAI-compatible gateway on another machine (or the same one, second process):
./target/release/openhydra-agent serve # binds 127.0.0.1:16527
# optional: require a key on /v1/* —
# --api-key <key> or OPENHYDRA_API_KEY=<key>
Then point any OpenAI client at it:
curl http://127.0.0.1:16527/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "llama3.2",
"messages": [{"role": "user", "content": "Write a haiku about peer-to-peer AI."}],
"stream": true
}'
The gateway also serves GET /v1/models (model ids discovered on the swarm) and
GET /health.
The gateway checks each provider's billed token count against the model's own
tokenizer. Which tokenizer that is comes from a signed index (built in, refreshed
daily from dl.openhydra.co); the tokenizer file itself is downloaded from
huggingface.co the first time a listed model is used, hash-checked, and cached in
~/.openhydra/tokenizers. --no-tokenizer-downloads (desktop: Settings → Network →
"Check billed token counts") turns the download off.
--engine-kind | Engine | Default port | Detection |
|---|---|---|---|
ollama | Ollama (native /api/*) | 11434 | /api/tags — full canonical ids |
vllm | vLLM (OpenAI /v1/*) | 8000 | /v1/models |
lm-studio | LM Studio (OpenAI /v1/*) | 1234 | /v1/models |
llama-cpp | llama-server (/props) | 8080 | /props → GGUF canonical id |
exo | Exo MLX cluster | 52415 | /state — only placed-and-ready models (not the full catalog) |
openai | Any OpenAI-compatible (LocalAI, …) | 8000 | /v1/models |
comfyui | ComfyUI (image / audio / video) | 8188 | /object_info/CheckpointLoaderSimple — SD checkpoints |
A three-crate Rust workspace:
network/ — the libp2p swarm: Kademlia DHT, mDNS, Circuit Relay v2,
DCUtR, AutoNAT v2, UPnP, and the request/response proxy. Exposes a synchronous
NetworkHandle to the agent and the openhydra-bootstrap binary.protocol/ — pure protocol logic: canonical model-id resolution, capability
records, the router (resolve → rank → route), co-signed receipts, and the redb
receipt ledger.agent/ — the runnable host (openhydra-agent): engine adapters, the
provider loop, and the OpenAI-compatible consumer gateway.Public bootstrap nodes (a small Rust openhydra-bootstrap binary on a few
VPS instances, dual-stack IPv4+IPv6 on :4001) seed DHT discovery and act as
relays for NAT'd peers. Deploy scripts live in ops/bootstrap/.
Historical throughput data from earlier builds lives in
benchmarks/. Because OpenHydra now proxies to an external
engine, end-to-end throughput is the engine's own tokens/sec plus the transport
overhead (LAN direct ≈ a few ms; relayed cross-NAT paths add a hop).
serve --no-tokenizer-downloads (or the desktop's "Check billed token
counts" switch) turns the download off.See SECURITY.md to report vulnerabilities.
Apache 2.0 — see LICENSE.