██╗ ██╗██╗███████╗███╗ ██╗████████╗ ██████╗
██║ ██║██║██╔════╝████╗ ██║╚══██╔══╝██╔═══██╗
██║ ██║██║█████╗ ██╔██╗ ██║ ██║ ██║ ██║
╚██╗ ██╔╝██║██╔══╝ ██║╚██╗██║ ██║ ██║ ██║
╚████╔╝ ██║███████╗██║ ╚████║ ██║ ╚██████╔╝
╚═══╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝
⚡ Ultra-Lightweight Distributed Edge Inference Mesh ⚡
Viento is the distributed AI inference mesh, powered by the featherweight Viento SDK (pip install -e . • CLI: viento).
Transform heterogeneous local workstations, cloud GPUs, and edge rigs into a unified, high-throughput, OpenAI-compatible AI cloud.
📚 Read the Docs • 📖 Detailed How-to-Run Guide • 📊 Stress Test Reports • ⚡ Lightning AI GPU Benchmarks
🧭 The 5 Essential Questions
1. What is this?
Viento is an ultra-lightweight, high-performance distributed inference mesh that networks diverse machines—from developer laptops and homelabs to spot cloud GPUs—into a single, virtualized AI compute cluster. It exposes a drop-in OpenAI-compatible chat completion endpoint (POST http://localhost:8000/v1/chat/completions) and SDK base URL (http://localhost:8000/v1) backed by the Viento edge agent, which connects local inference engines (Ollama, vLLM, llama.cpp, PyTorch) via persistent, reverse asynchronous WebSocket tunnels.
2. Who is it for?
- AI Developers & Indie Hackers: Who want to serve LLMs locally or across free/cheap cloud GPUs (Lightning AI, Kaggle, Colab) and access them through any standard OpenAI client library without paying $100s/month to cloud providers.
- Startups & Teams: Who have multiple workstations or on-prem servers with RTX 3090/4090s and want to pool their compute into an internal API cluster for their engineers.
- Homelab & Self-Hosting Enthusiasts: Who want to run local models behind residential internet/NAT without messing with router port forwarding, DDNS, or exposing their home IP.
- Compute Providers & GPU Owners: Who want to monetize or share idle GPU capacity effortlessly with zero heavyweight daemon overhead.
3. Why would I care?
- 💸 Zero Cloud GPU Lock-In: Stop paying 24/7 pricing for idle cloud GPU instances. Turn on compute only when you need it, wherever you have it.
- 🪶 Ultra-Lightweight Footprint: The Viento agent consumes under 25 MB RAM and virtually 0% idle CPU. No heavy Docker engines required, no kernel modules, just pure asynchronous Python (
asyncio). - 🛡️ Instant Firewall Penetration (Reverse WSS Tunnels): Workers establish outbound secure WebSocket tunnels to
ws://localhost:8000/ws/runtime(or your remote gateway). No public IP, no open ports, and no NAT punch-through required. - ⚡ Sub-2ms Cancellation Teardown: If a user cancels a query mid-stream, Viento aborts the local engine's generation socket with sub-2ms latency in benchmarks, freeing your VRAM immediately instead of wasting GPU compute.
- 📦 Zero-Token-Loss Architecture: Invariant-tested backpressure queues and sequence tracking verified 100% token integrity without dropped chunks across parallel stress bursts in test environments.
4. How do I run it?
Viento offers two fast modes:
Option A: 1-Command Instant GPU Sharing (Zero Setup)
Share your local GPU instantly with teammates or apps across the internet via Cloudflare Quick Tunnel:
# 1. Install with server extras
pip install -e ".[server]"
# 2. Boot in-process gateway + Cloudflare tunnel + worker in 1 command
viento run --standalone
# or shortcut:
viento run --tunnel
Viento outputs your public OpenAI Base URL (https://<subdomain>.trycloudflare.com/v1) and Master API Key ready for immediate querying.
Option B: Self-Hosted Gateway Mesh Network
# 1. In Terminal 1: Launch central server gateway
viento serve --port 8000
# 2. In Terminal 2: Make sure your local engine is running (e.g. Ollama)
ollama run llama3:latest
# 3. In Terminal 3: Connect edge worker node to gateway mesh
export VIENTO_BOOTSTRAP_KEY=<your-bootstrap-key> # Contact cluster admin or set custom cluster key
viento run --server ws://localhost:8000/ws/runtime
(For comprehensive instructions across Linux, Windows, vLLM, Lightning AI T4, and Kaggle, see the HOW_TO_RUN.md Guide.)
5. What do I do after running it?
Once your node connects (or your standalone tunnel boots), it outputs your OpenAI-compatible endpoint. You can immediately:
- Query via OpenAI Python SDK: Point
base_url="http://localhost:8000/v1"(orhttps://<subdomain>.trycloudflare.com/v1) with your API key to stream completions fromPOST /v1/chat/completionsin real-time. - Direct HTTP / cURL: Send chat completion payloads directly to
/v1/chat/completionsor/v1/embeddings. - Connect Developer Tools: Plug your OpenAI Base URL into Cursor, Continue.dev, Open-WebUI, LangChain, or LlamaIndex as a drop-in OpenAI replacement.
- Scale Compute: Boot up additional instances on free GPUs (like a Lightning AI Tesla T4 or Kaggle notebook) to automatically increase your mesh's parallel capacity.
- Monitor Real-Time Hardware: Run
viento statusto monitor live VRAM, power draw, temperatures, and throughput across your active workers.
🌌 Core Philosophy: Featherweight & Blazing Fast
Traditional distributed AI frameworks require heavyweight distributed runtimes, Kubernetes operators, and static ingress controllers. Viento discards this bloat in favor of minimal, hyper-focused primitives:
- Asynchronous Reverse Multiplexing: Nodes maintain persistent HTTP/2 and WebSocket connections to the cloud gateway. Requests are dispatched downstream as lightweight binary/JSON frames and streamed back token-by-token over Server-Sent Events (SSE).
- Sub-Millisecond Stream Dispatch: Routing decisions and capacity checks occur in memory via
asyncio.Semaphoreguards, introducing negligible latency (< 1ms overhead). - Ephemeral Session Security: Workers receive temporary cryptographically scoped session keys (
vnt_tmp_...) with automatic TTL expiry, isolating clients without heavyweight key infrastructures. - Hardware Agnostic: Run FP16 weights on NVIDIA GPUs, quantized GGUFs on Apple Silicon with Metal, or CPU inference on edge devices seamlessly.
🏛️ System Architecture
Viento operates on a dual-plane architecture: a Viento Server Gateway (viento serve or dedicated cloud host), and distributed Viento Edge Runtime Nodes.
flowchart TD
subgraph Clients["Clients & Applications"]
C1["OpenAI Python SDK"]
C2["Web UI / Chatbot"]
C3["LangChain / Agents"]
end
subgraph Gateway["Viento Gateway (http://localhost:8000)"]
GW_API["REST API Router (/v1/chat/completions)"]
DISP["Multi-Tier Capacity Dispatcher"]
REG["Active Session & Model Registry"]
WS_HUB["WebSocket Hub (/ws/runtime)"]
end
subgraph Mesh["Distributed Worker Mesh"]
subgraph Node1["Edge Node A (Local Workstation)"]
V1["Viento Runtime Agent"]
ENG1["Ollama (llama3:8b)"]
end
subgraph Node2["Edge Node B (Cloud GPU - Lightning AI)"]
V2["Viento Runtime Agent"]
ENG2["vLLM (Tesla T4 - FP16)"]
end
subgraph Node3["Edge Node C (Edge Server)"]
V3["Viento Runtime Agent"]
ENG3["llama.cpp (Phi-3 Mini)"]
end
end
C1 & C2 & C3 -->|"HTTPS (SSE Streaming)"| GW_API
GW_API --> DISP
DISP --> REG
DISP --> WS_HUB
WS_HUB <-->|"Secure WSS Reverse Tunnel (Pydantic V2)"| V1
WS_HUB <-->|"Secure WSS Reverse Tunnel (Pydantic V2)"| V2
WS_HUB <-->|"Secure WSS Reverse Tunnel (Pydantic V2)"| V3
V1 <--> ENG1
V2 <--> ENG2
V3 <--> ENG3
🔬 Architectural Deep-Dive
1. Canonical Wire Protocol (Version 1.0)
All communication over the WebSocket mesh tunnel utilizes strictly validated Pydantic V2 Envelopes (extra="forbid"), preventing protocol injection and schema drift:
{
"version": "1.0",
"type": "job_request",
"message_id": "msg_8f12a0c49b1e",
"sequence": 42,
"timestamp": 1725301824.51,
"job_id": "job_a93f1208",
"request_id": "req_55b0a3f1",
"session_id": "vnt_sess_7a3d12c8",
"payload": {
"model": "llama3:latest",
"messages": [{"role": "user", "content": "Explain gravity."}],
"temperature": 0.7,
"max_tokens": 512,
"stream": true
}
}
- Monotonic Directional Sequencing: Ensures packet delivery order is verified across both directions.
- Heartbeat & Liveness: Nodes report hardware stats (CPU, RAM, GPU utilization, VRAM, and temperatures) every 15 seconds. If a node drops, the gateway re-routes jobs automatically.
2. Token Lifecycle & Zero-Token-Drop Pipeline
sequenceDiagram
autonumber
actor User as Client / App
participant Gateway as Viento Gateway
participant Viento as Viento Edge Node
participant Engine as Local Inference Engine (Ollama / vLLM)
User->>Gateway: POST /v1/chat/completions (stream=True)
Gateway->>Gateway: Resolve model & match active worker node
Gateway->>Viento: WS Frame: JOB_REQUEST (job_id, prompt)
Viento->>Viento: Enqueue in FIFO Queue & check capacity
Viento->>Gateway: WS Frame: JOB_ACK (queue_position)
Viento->>Engine: Stream generation request via ExecutionHandle
loop Token Streaming
Engine-->>Viento: Token chunk delta
Viento-->>Gateway: WS Frame: TOKEN_CHUNK (token, index)
Gateway-->>User: SSE Chunk: data: {"choices":[{"delta":{"content":...}}]}
end
Engine-->>Viento: Generation finished
Viento-->>Gateway: WS Frame: JOB_COMPLETE (metrics, total_tokens)
Gateway-->>User: SSE Chunk: data: [DONE]
3. Atomic Concurrency Bounding & Backpressure Protection
Each Viento node protects itself from resource exhaustion using an internal multi-stage queue and semaphore supervisor:
asyncio.Semaphore(max_concurrency): Limits the number of parallel inference requests touching local GPU/CPU compute simultaneously.- Bounded FIFO Queue (
max_queue_depth=50): When incoming traffic surges beyond maximum queue depth, Viento immediately rejects excess jobs withJOB_ERROR (queue_full), signaling the Cloud Gateway to shed load or route to an alternate worker. - Instant Cancellation (
ExecutionHandle.cancel()): If a client cancels their request or closes their browser, the Gateway sends aCANCEL_JOBframe. Viento immediately closes the HTTP connection to Ollama/vLLM, terminating compute generation with observed sub-2ms local teardown in benchmark cancellation tests.
⚡ Cloud GPU Validation: NVIDIA Tesla T4
To prove Viento's cross-environment capability, the full system was launched and evaluated on a live cloud instance featuring an NVIDIA Tesla T4 GPU (16 GB VRAM) on Lightning AI:
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.173.02 Driver Version: 580.173.02 CUDA Version: 13.0 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
|=========================================+========================+======================|
| 0 Tesla T4 Off | 00000000:00:1E.0 Off | 0 |
| N/A 48C P0 26W / 70W | 1047MiB / 15360MiB | 12% Default |
+-----------------------------------------+------------------------+----------------------+
📈 T4 Benchmark Highlights
- FP16 Matrix Compute: 24.19 TFLOPS sustained on FP16 Tensor Cores.
- Model Loaded:
Qwen/Qwen2.5-0.5B-Instructin pure FP16 (cuda:0). - Cold Boot Time: Model weight loading into VRAM in 1.67 seconds.
- VRAM Footprint: Only 1,047.9 MB VRAM utilized.
- Generation Speed: 28.05 tokens/second generation throughput.
- Test Suite Execution: Historical Lightning AI T4 validation: 71 of 71 unit tests passed in 4.11 seconds directly on the cloud GPU node (prior to the v0.4.0 test suite expansion to 82 tests).
📊 Concurrency Stress & Throughput Benchmarks
We subjected Viento's scheduling core to intensive in-memory async stress tests across varying concurrency levels to validate queue backpressure enforcement and streaming fidelity:
| Concurrency Level | Total Requests | Total Tokens | Duration | Throughput | p50 Latency | p95 Latency | Dropped Tokens | Status |
|---|---|---|---|---|---|---|---|---|
| 1x | 6 jobs | 96 | 0.10s | 933.6 tok/s | 72.5 ms | 99.7 ms | 0 (0.0%) |
🟢 PASSED |
| 2x | 12 jobs | 192 | 0.13s | 1,473.6 tok/s | 83.0 ms | 127.8 ms | 0 (0.0%) |
🟢 PASSED |
| 4x | 24 jobs | 384 | 0.23s | 1,667.6 tok/s | 143.1 ms | 209.7 ms | 0 (0.0%) |
🟢 PASSED |
| 8x | 48 jobs | 768 | 0.51s | 1,513.9 tok/s | 389.0 ms | 489.9 ms | 0 (0.0%) |
🟢 PASSED |
| 16x | 96 jobs | 1,536 | 0.75s | 2,048.5 tok/s | 474.3 ms | 730.3 ms | 0 (0.0%) |
🟢 PASSED |
Detailed Report: See test_results/STRESS_TEST_REPORT.md and test_results/benchmark_report.json for full metrics.
🎯 Supported Inference Backends
Viento abstracts backend engines through a unified interface (InferenceBackend), allowing you to mix and match hardware transparently:
┌──────────────────────┐
│ InferenceBackend │
│ (Abstract Adapter) │
└──────────┬───────────┘
┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ OllamaAdapter │ │ VLLMAdapter │ │ LlamaCppAdapter │
│ • HTTP /api/chat│ │ • Async OpenAI │ │ • C++ Server │
│ • Auto Pull │ │ • PagedAttention│ │ • GGUF Quantized│
│ • Llama3, Phi3 │ │ • High Throughput││ • Pure CPU/Metal│
└──────────────────┘ └──────────────────┘ └──────────────────┘
- Ollama: Default adapter for local development. Auto-discovers local models and handles streaming chunks.
- vLLM: Optimized for multi-GPU cloud instances with PagedAttention and continuous batching.
- llama.cpp: Minimal footprint server adapter for quantized GGUF execution on CPU or Apple Silicon.
- HuggingFace Transformers: Direct in-memory execution for custom fine-tuned weights.
🚀 How to Run Viento
For full step-by-step instructions on running each component, connecting nodes, and deploying on cloud GPUs, read the dedicated guide:
👉 Read the Complete HOW_TO_RUN.md Guide 👈
Quick Command Cheat Sheet:
# 1. Install the lightweight Viento SDK
pip install -e .
# 2. Start your local Ollama or vLLM engine
ollama run llama3:latest
# 3. Connect your node to the gateway mesh
export VIENTO_BOOTSTRAP_KEY=<your-bootstrap-key>
viento run --server ws://localhost:8000/ws/runtime
# 4. Query the mesh via OpenAI SDK
curl http://localhost:8000/v1/models
🛡️ Reliability & Test Matrix
Viento includes an exhaustive automated test suite covering protocol invariants, network drops, session recovery, queue overflows, and concurrency stress:
- 82 of 82 Unit & Stress Tests Passing (100%):
test_backends.py: Backend adapter contracts & execution handles (7 passed)test_concurrency_stress.py: Burst bounding, backpressure, rapid cancellation, zero token drop (5 passed)test_e2e_mesh_stress.py: Pydantic V2 schema tampering defense & monotonic sequence validation (3 passed)test_ollama_adapter.py: Stream token dispatch, health checks, model discovery (7 passed)test_protocol.py: Wire serialization, deserialization, and payload invariants (26 passed)test_reconnection.py: Reconnect handshake, session resync, and backoff (10 passed)test_sdk.py: CLI commands, configuration manager, bootstrap key environment wiring, process management, and scheduler draining (12 passed)test_telemetry.py: Non-blocking GPU metrics, thread-safe request counters, secret masking (12 passed)
# Run the test suite locally
pytest tests/ -v
🗺️ Roadmap & What's Next
- Canonical Wire Protocol V1.0 with strict Pydantic V2 schemas.
- Multi-engine backend support (Ollama, vLLM, llama.cpp).
- Self-hosted and cloud Gateway deployment (
viento serve/viento gateway). - Cloudflare Quick Tunnel integration (
viento serve --tunnelandviento run --standalone). - Distributed Embedding model routing (
POST /v1/embeddings). - Validated Cloud GPU execution on NVIDIA Tesla T4.
- High-throughput concurrency stress testing and zero-token-drop verification.
- Intelligent Token-Aware Multi-Node Speculative Decoding.
- WebRTC P2P Direct Node-to-Client Data Channels for ultra-low latency.
📄 License
Viento is licensed under the MIT License. Built with ❤️ for decentralized, accessible, and ultra-lightweight AI computing.
Metadata
Release files for viento 0.4.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| viento-0.4.19.tar.gz | 167.7 kB | Without provenance | Details for viento-0.4.19.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| viento-0.4.19-py3-none-any.whl | Python 3 | none | any | Details for viento-0.4.19-py3-none-any.whl |
Total release size: 279.7 kB
Release files / viento-0.4.19.tar.gz
| Download URL | viento-0.4.19.tar.gz |
|---|---|
| Size | 167.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6807942848ecb309bd34a00b08ab6051bd59528f2cddad8d64337c1d5b190d9
|
|
BLAKE2b-256 checksum How to use checksums |
2152accb7796d214eb69436662e1ff0400b5597a5b8bd748706294c0e3b60bfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / viento-0.4.19-py3-none-any.whl
| Download URL | viento-0.4.19-py3-none-any.whl |
|---|---|
| Size | 112.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e47145c16b9fc156ff7aff43cfb664b95f8eb81f1830d475264fdfa3d1a33076
|
|
BLAKE2b-256 checksum How to use checksums |
f568df5bd01900fc0a4e9abd559f47087a0904518fd1e7c2b15b7a830b9d35f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for viento 0.4.19
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.