Peer-to-peer distributed inference for open-source language models
Project description
_ ____ _
| | | __`\(_)
| | __ _ ___ ___ _ _ __ _ __ _ ___ | |__) | |_ __ ___ ___
| | / _` |/ _ \ / _ `| | | |/ _` |/ _` |/ _ \ | ___/| | '_ \ / _ \/ __|
| |___| (_| | | | | (_| | |_| | (_| | (_| | __/ | | | | |_) | __/\__ \
|______\__,_|_| |_|\__, |\__,_|\__,_|\__, |\___| |_| |_| .__/ \___||___/
__/ | __/ | | |
|___/ |___/ |_|
Peer-to-peer distributed inference for open-source language models
Language Pipes is an open-source distributed inference system built on the transformers library that splits large language model computation across multiple machines. By separating the model's text-handling components (embedding and output head) from its intermediate transformer layers, Language Pipes enables peer-to-peer inference.
Features
- OpenAI-compatible API
- Automatic model download by HuggingFace ID
- Interactive TUI for configuration, monitoring, and control
- Decentralized peer-to-peer network with optional AES encryption
How It Works
Language models process input through a sequence of transformer layers. Each layer performs matrix multiplications between learned weights and a hidden state tensor, passing the result to the next layer. Language Pipes distributes these layers across machines, splitting the memory cost across the network while keeping the text-handling components on the origin node.
The architecture provides architectural separation: layer models operate on continuous-valued tensors rather than discrete text while the end models keep text data on trusted systems. The privacy documentation provides a probabilistic threat model that quantifies the difficulty of known inversion attacks under various mitigation configurations.
Further reading:
- Architecture Overview: runtime components and inference flow
- Job Processor State Machine: how jobs traverse the distributed pipeline
Installation
Requires Python 3.10+. For GPU support, install the appropriate PyTorch version for your CUDA configuration:
https://pytorch.org/get-started/locally/
Install from pip:
pip install language-pipes
Quick Start
Launch the interactive TUI:
language-pipes
From the main menu, select New Configuration and give it a name to create a TOML config and open the dashboard (or Load Configuration to reopen one you've created before).
The dashboard is organized into tabs along the top: Home, Network, Models, Pipes, and Jobs. A fresh configuration has no node ID yet, so the only option on Home is Configure Network Server. Set a Node ID under Network > Configure, then return to Home and select Start Network Server. Once the network is running, the dashboard exposes the rest of setup: load models under Models > Layer Models / End Models, and configure and start the OpenAI-compatible API under Jobs > Server.
Configuration can also be edited directly as TOML files and run headlessly. See the CLI reference for details on running a saved configuration from the command line.
Two Node Example
This example distributes Qwen/Qwen3-1.7B across two computers. Node 1 hosts the End Model, so prompts and responses stay on Node 1, plus enough layers to fit in its memory. Node 2 hosts the remaining layers.
Node 1 (First Computer)
language-pipes
Select New Configuration and name it (e.g. node-1).
- Network > Configure: set Node ID to
node-1and ensure Network IP is set to this machine's local IP address. Leave Network Key empty to disable encryption for this example. Peer Port defaults to5000. - Back on Home, select Start Network Server.
- Models > Installed: select Install New Model and enter
Qwen/Qwen3-1.7Bto download it. - Models > Layer Models: select Add Layer Model, choose
Qwen/Qwen3-1.7B, a device (cpuorcuda:0), and a memory budget in GB (e.g.2), then Save Model. Confirm to load it now. - Models > End Models: select Add End Model, choose
Qwen/Qwen3-1.7B, and confirm to load it now. - Jobs > Server: ensure the Port is set to
8000and select Start Server.
Node 2 (Second Computer)
language-pipes
Select New Configuration and name it (e.g. node-2).
- Network > Configure: set Node ID to
node-2. Under Bootstrap Nodes, add an entry with node-1's IP address and peer port (5000) so this node joins node-1's network. - Back on Home, select Start Network Server.
- Models > Installed: install
Qwen/Qwen3-1.7Bas on Node 1. - Models > Layer Models: add
Qwen/Qwen3-1.7Bwith a device and memory budget covering the remaining layers (e.g.2oncpu).
Once both nodes have loaded their layers, Pipes > Complete shows a completed pipe for Qwen/Qwen3-1.7B, and the model is ready for inference via node-1's Job Port.
Test the API
The model is accessible via the OpenAI-compatible API.
Example using the OpenAI Python library:
from openai import OpenAI
client = OpenAI(
base_url="http://127.0.0.1:8000/v1", # node-1 IP address and Job Port
api_key="not-needed" # only required if api_keys is set in the config
)
response = client.chat.completions.create(
model="Qwen/Qwen3-1.7B",
max_completion_tokens=100,
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a haiku about distributed systems."}
]
)
print(response.choices[0].message.content)
Install the OpenAI library with: pip install openai
See the OpenAI-compatible API documentation for the full endpoint reference and sampling parameter descriptions.
Supported Models
Language Pipes currently supports a few model families including Qwen3, Phi, Meta Llama 3.1/3.2, and Gemma 3. View all tested models here
Planned Improvements
- Additional model architectures
- INT8 and INT4 quantization (currently all inference uses fp16)
- GGUF format support (currently requires safetensors)
Dependencies
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file language_pipes-2.0.0.tar.gz.
File metadata
- Download URL: language_pipes-2.0.0.tar.gz
- Upload date:
- Size: 189.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de96a37bc176e3b017b264b1b484fc45ef469a5f0fb9f561eb50eb256f956fb6
|
|
| MD5 |
c9af71e6925222cc662a525b3df3b365
|
|
| BLAKE2b-256 |
ce4015f4dce2b1cdcd4ae283193ea3cffd28a4ae6390a117934eb5c62fa4fb00
|
Provenance
The following attestation bundles were made for language_pipes-2.0.0.tar.gz:
Publisher:
publish.yml on erinclemmer/language-pipes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
language_pipes-2.0.0.tar.gz -
Subject digest:
de96a37bc176e3b017b264b1b484fc45ef469a5f0fb9f561eb50eb256f956fb6 - Sigstore transparency entry: 1864507642
- Sigstore integration time:
-
Permalink:
erinclemmer/language-pipes@a4d0e1ffb0f8e9ec7227301917f1f401efdba1b4 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/erinclemmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a4d0e1ffb0f8e9ec7227301917f1f401efdba1b4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file language_pipes-2.0.0-py3-none-any.whl.
File metadata
- Download URL: language_pipes-2.0.0-py3-none-any.whl
- Upload date:
- Size: 162.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4188fb9430fc031673a1de07d74470300ba1828d3bb4a03e0282f0e7ae93c501
|
|
| MD5 |
af1a16fc026f8ecc2e1b81d2e94455db
|
|
| BLAKE2b-256 |
3fdf93b71c8972ad3dc5cab62c77687ee38b2af9a0d04e6f82c10d955a473fad
|
Provenance
The following attestation bundles were made for language_pipes-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on erinclemmer/language-pipes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
language_pipes-2.0.0-py3-none-any.whl -
Subject digest:
4188fb9430fc031673a1de07d74470300ba1828d3bb4a03e0282f0e7ae93c501 - Sigstore transparency entry: 1864507846
- Sigstore integration time:
-
Permalink:
erinclemmer/language-pipes@a4d0e1ffb0f8e9ec7227301917f1f401efdba1b4 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/erinclemmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a4d0e1ffb0f8e9ec7227301917f1f401efdba1b4 -
Trigger Event:
release
-
Statement type: