Thanks for your interest in SwarmLLM. This document covers the basics for getting a contribution merged.
Requires Rust 1.89+.
git clone https://github.com/enapt/SwarmLLM.git
cd SwarmLLM
# CPU-only
cargo build --release
# With CUDA GPU acceleration
cargo build --release --features candle-cuda# Unit and module tests
cargo test
# Integration tests (must run single-threaded)
cargo test --test integration -- --test-threads=1Every PR must pass these checks locally before submission:
cargo fmt
cargo clippy --all-targets -- -D warningsZero clippy warnings. No exceptions.
- Fork the repo and create a branch off
main. - Make your changes. Keep commits focused — one logical change per commit.
- Write commit messages in imperative mood ("Add retry logic for shard downloads", not "Added retry logic").
- Run
cargo fmt,cargo clippy, andcargo testbefore pushing. - Open a PR against
main.
- Does it compile and pass CI? This is the minimum bar.
- Is it tested? New functionality should have unit tests. Bug fixes should have a regression test where practical.
- Is it focused? PRs that do one thing well get reviewed faster than sprawling changes.
- Does it match existing patterns? Follow the conventions in
CLAUDE.md— error handling withthiserror,DashMapfor shared state,mpscchannels between subsystems, structuredtracinglogging. - No unnecessary dependencies. The binary is ~33–50 MB depending on platform and features. We want to keep it lean.
Open a GitHub Issue using the bug report template. Include:
- Steps to reproduce
- Expected vs actual behavior
- OS, Rust version, GPU (if relevant)
- Log output with
-vvflag if applicable
Open a GitHub Issue using the feature request template. Describe the use case, not just the solution.
# CPU image
docker build -t swarmllm .
docker run -p 8800:8800 -v swarmllm-data:/data swarmllm
# CUDA GPU image
docker build -f Dockerfile.cuda -t swarmllm:cuda .
docker run --gpus all -p 8800:8800 -v swarmllm-data:/data swarmllm:cuda
# 3-node test cluster
docker compose upThe codebase is a Cargo workspace with three crates:
swarmllm(root) — main binary and all subsystem logiccrates/swarmllm-types/— shared data types (78 types: NodeId, ModelManifest, SwarmMessage, etc.)crates/swarmllm-frontend/— embedded or dev-mode frontend asset serving
Key directories:
src/daemon/— startup, shared state, message dispatchsrc/network/— libp2p networking, peer discovery, transportsrc/inference/— router, pipeline, executor, split inferencesrc/api/— HTTP server, OpenAI/Anthropic endpoints, admin dashboardsrc/credit/— credit system, transactions, anti-gamingfrontend/— vanilla HTML/CSS/JS dashboard (no build step):js/core/(4 modules: state, utils, data, tooltip),js/components/(17 UI modules),js/init.js, 4 standalone utilities (i18n, providers, neural-bg, topojson-client), 11 HTML<template>elements, 21 i18n languages
Do not open a public issue for security vulnerabilities. See SECURITY.md for responsible disclosure instructions.
By contributing, you agree that your contributions will be dual-licensed under MIT and Apache 2.0, consistent with the project license.