Skip to main content
 __      __  .___  ___________  _______  ___________  ________
/  \    /  \ |   | \_   _____/  \      \ \__    ___/  \_____  \
\   \/\/   / |   |  |    __)_   /   |   \  |    |      /   |   \
 \        /  |   |  |        \ /    |    \ |    |     /    |    \
  \__/\  /   |___| /_______  / \____|__  / |____|     \_______  /
       \/                  \/          \/                     \/

         Distributed AI Inference · Edge-to-Cloud · Open Source

Viento SDK

Run your local LLMs. Connect to the cloud mesh. Serve the world.

PyPI version Python Versions License: MIT Tests Code Style: Black GitHub Stars


⚡ What is Zephyr?

Zephyr is a robust, lightweight distributed inference runtime. It lets you take your local GPU/CPU machine running Ollama, llama.cpp, or vLLM and plug it into the Zephyr Cloud mesh — instantly turning it into a globally-addressable AI inference node.

Once connected, any client with a session key can hit your node through the standard OpenAI-compatible API (/v1/chat/completions, /v1/embeddings, /v1/models) — from anywhere on the internet.

Your Machine (GPU/CPU)          Zephyr Cloud Gateway          Your Users
────────────────────           ────────────────────          ────────────
 Ollama llama3:latest   ◄─WSS─►  zephyr-i2ho.onrender.com  ◄─HTTPS─►  API Clients
 llama.cpp phi3          secure    job routing &          OpenAI-compatible
 vLLM mistral           tunnel    load balancing          SDK / curl / apps

🚀 Installation

pip install viento

Or install from source for the latest unreleased features:

git clone https://github.com/abhinav00anand/zephyr.git
cd viento/SDK
pip install -e ".[dev]"

Requirements: Python ≥ 3.9 · Ollama (recommended) or llama.cpp / vLLM


🖥 CLI Reference

Start Your Node

viento run

Boots the runtime, connects to wss://zephyr-i2ho.onrender.com/ws/runtime, performs the HELLO→WELCOME→REGISTER→SESSION_READY handshake, and begins receiving jobs. On success, your terminal displays:

╔══════════════════════════════════════════════════════════════╗
║               ⚡  ZEPHYR NODE AUTHENTICATED  ⚡              ║
╠══════════════════════════════════════════════════════════════╣
║  Session ID  : zph_sess_8f9a12c4                            ║
║  API Key     : zph_tmp_8f9a2b4c...  (1-hour TTL)           ║
║  Models      : llama3:latest, phi3:mini, mistral:7b         ║
║  Backend     : Ollama @ http://localhost:11434               ║
║  Status      : 🟢 Online — awaiting jobs                    ║
╚══════════════════════════════════════════════════════════════╝

All Commands

Command Description
viento run Start the runtime node and connect to cloud
viento run --server wss://... Connect to a custom gateway
viento run --concurrency 4 Override max concurrent jobs
viento status Show session, TTL, active jobs, and metrics
viento models List all locally discovered models
viento pull llama3:latest Pull model weights via Ollama
viento doctor Diagnose Ollama, GPU, RAM, and network
viento config view View current configuration
viento config set <key> <value> Update a config value
viento stop Gracefully drain jobs and disconnect

🐍 Python Client Usage

Synchronous Chat

from viento.client.client import VientoClient

client = VientoClient(
    base_url="https://zephyr-i2ho.onrender.com",
    api_key="zph_tmp_your_session_key",
)

response = client.chat.completions.create(
    model="llama3:latest",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user",   "content": "Explain quantum entanglement."},
    ],
    temperature=0.7,
    max_tokens=512,
)

print(response.choices[0].message.content)

Streaming (Real-Time Tokens)

stream = client.chat.completions.create(
    model="llama3:latest",
    messages=[{"role": "user", "content": "Write a haiku about distributed systems."}],
    stream=True,
)

for chunk in stream:
    print(chunk.choices[0].delta.content, end="", flush=True)

Async Client

import asyncio
from viento.client.client import AsyncVientoClient

async def main():
    client = AsyncVientoClient(api_key="zph_tmp_...")
    response = await client.chat.completions.create(
        model="phi3:latest",
        messages=[{"role": "user", "content": "Hello, Zephyr!"}],
    )
    print(response.choices[0].message.content)

asyncio.run(main())

Embeddings

result = client.embeddings.create(
    model="all-minilm:latest",
    input=["The quick brown fox", "jumps over the lazy dog"],
)

for i, embedding in enumerate(result.data):
    print(f"Input {i}: {len(embedding.embedding)}-dim vector")

🏗 Architecture

                    ┌─────────────────────────────────────────┐
                    │           Zephyr Cloud Gateway          │
                    │     wss://zephyr-i2ho.onrender.com           │
                    │                                         │
                    │  ┌──────────┐  ┌──────────────────────┐ │
                    │  │  API GW  │  │  RuntimeManager      │ │
                    │  │ /v1/chat │  │  - Session Registry  │ │
                    │  │ /v1/emb  │  │  - Job Routing       │ │
                    │  │ /v1/models│ │  - Heartbeat Monitor │ │
                    │  └──────────┘  └──────────────────────┘ │
                    └──────────────────┬──────────────────────┘
                                       │
                               WSS · ProtocolEnvelope v1.0
                               (HELLO/WELCOME/REGISTER/JOB/...)
                                       │
         ┌─────────────────────────────▼───────────────────────────────┐
         │                     Zephyr Edge Node                        │
         │                                                             │
         │   ┌─────────────────────┐     ┌───────────────────────────┐ │
         │   │  ConnectionManager  │────►│       JobScheduler        │ │
         │   │  ▸ WSS Client       │     │  ▸ FIFO async queue       │ │
         │   │  ▸ Exponential BO   │     │  ▸ Semaphore concurrency  │ │
         │   │  ▸ Heartbeat 15s    │     │  ▸ ExecutionHandle cancel │ │
         │   │  ▸ Seq. Validation  │     │  ▸ State machine (6 states│ │
         │   └──────────┬──────────┘     └────────────┬──────────────┘ │
         │              │                             │                 │
         │   ┌──────────▼──────────┐    ┌────────────▼──────────────┐  │
         │   │   ConfigManager     │    │    Inference Backends      │  │
         │   │  ~/.viento/         │    │  ▸ OllamaAdapter          │  │
         │   │    config.toml      │    │  ▸ LlamaCppAdapter        │  │
         │   │    runtime.json     │    │  ▸ VLLMAdapter            │  │
         │   └─────────────────────┘    └───────────────────────────┘  │
         │                                                             │
         │   ┌──────────────────────────────────────────────────────┐  │
         │   │                  TelemetryCollector                  │  │
         │   │   CPU · RAM · GPU VRAM · Latency Histograms · Logs   │  │
         │   └──────────────────────────────────────────────────────┘  │
         └─────────────────────────────────────────────────────────────┘

Core Components

Component Location Role
ConnectionManager viento/connection/manager.py WSS supervisor, handshake, heartbeat, reconnect
JobScheduler viento/scheduler/scheduler.py FIFO queue, semaphore, cancellation state machine
OllamaAdapter viento/backends/ollama.py NDJSON streaming, TCP-abort cancellation
LlamaCppAdapter viento/backends/llamacpp.py llama.cpp server v1/chat/completions
VLLMAdapter viento/backends/vllm.py vLLM OpenAI-compat endpoint
ProtocolEnvelope viento/protocol/envelope.py Canonical WSS framing (v1.0)
TelemetryCollector viento/telemetry/collector.py Hardware stats + latency histograms
ConfigManager viento/config/loader.py Persistent config, secure key stripping
VientoClient viento/client/client.py OpenAI-compatible Python client

📁 Repository Structure

SDK/
├── 📄 pyproject.toml          ← Package metadata & tooling
├── 📄 README.md               ← This file
├── 📄 CHANGELOG.md            ← Release history
├── 📄 CONTRIBUTING.md         ← Contribution guide
├── 📄 CODE_OF_CONDUCT.md      ← Community standards
│
├── 📂 viento/             ← Main package source
│   ├── 📄 __init__.py
│   ├── 📂 backends/           ← Inference engine adapters
│   │   ├── 📄 base.py         ← Abstract base + handles
│   │   ├── 📄 ollama.py       ← Ollama REST adapter
│   │   ├── 📄 llamacpp.py     ← llama.cpp adapter
│   │   └── 📄 vllm.py         ← vLLM adapter
│   ├── 📂 cli/                ← CLI commands
│   │   ├── 📄 main.py         ← Click group entry point
│   │   └── 📄 commands.py     ← run, status, models, pull ...
│   ├── 📂 client/             ← Python SDK client
│   │   └── 📄 client.py       ← VientoClient / AsyncVientoClient
│   ├── 📂 config/             ← Config & state management
│   │   └── 📄 loader.py       ← ConfigManager, RuntimeState
│   ├── 📂 connection/         ← WebSocket supervisor
│   │   └── 📄 manager.py      ← ConnectionManager
│   ├── 📂 protocol/           ← Wire protocol engine
│   │   ├── 📄 envelope.py     ← Pydantic envelope models
│   │   └── 📄 validator.py    ← Sequence tracking & validation
│   ├── 📂 scheduler/          ← Job queue and executor
│   │   └── 📄 scheduler.py    ← JobScheduler (6-state machine)
│   └── 📂 telemetry/          ← Observability layer
│       ├── 📄 collector.py    ← Hardware + latency metrics
│       └── 📄 logging.py      ← JSON logger with secret masking
│
├── 📂 tests/                  ← Test suite (47 tests, 100% pass)
│   ├── 📄 test_backends.py
│   ├── 📄 test_ollama_adapter.py
│   ├── 📄 test_protocol.py
│   ├── 📄 test_sdk.py
│   └── 📄 test_telemetry.py
│
└── 📂 docs/                   ← Extended documentation
    ├── 📄 architecture.md
    ├── 📄 cli_guide.md
    └── 📄 ollama_integration_guide.md

🔐 Security Design

  • No secrets on disk: Active API keys (zph_tmp_...) are kept only in process memory. The RuntimeState model strips keys before any disk write.
  • TLS by default: All cloud connections use wss:// (WebSocket Secure).
  • Secret masking in logs: The SecretMasker regex masks any zph_tmp_... pattern in structured logs.
  • Sequence validation: The SequenceTracker detects replay attacks and packet reordering in both directions.
  • Connection isolation: Each WSS session uses a unique session_id; unauthorized frame injection is rejected at the envelope level.

🧪 Testing

# Install dev dependencies
pip install -e ".[dev]"

# Run full test suite
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=viento --cov-report=html

Test Coverage Summary:

Module Tests
Backend Adapters (Ollama, llama.cpp, vLLM) 14 tests
Protocol Envelopes & Sequence Tracking 16 tests
Scheduler, Config, Connection, Client 9 tests
Telemetry & Logging 8 tests
Total 47 tests · 100% passing

🤝 Contributing

We welcome contributions! Please read CONTRIBUTING.md first.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/amazing-feature
  3. Run the tests: pytest tests/
  4. Push and open a Pull Request

📜 License

MIT License © 2026 Zephyr Cloud Team. See LICENSE for details.


Made with ⚡ by the Zephyr Cloud team.

⭐ Star us on GitHub · 📦 PyPI Package · 🐛 Report a Bug

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

viento-0.2.7.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

viento-0.2.7-py3-none-any.whl (52.2 kB view details)

Uploaded Python 3

File details

Details for the file viento-0.2.7.tar.gz.

File metadata

  • Download URL: viento-0.2.7.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for viento-0.2.7.tar.gz
Algorithm Hash digest
SHA256 15e463ccd7f3857b37877ae852eab49d09862734e72d5ae46c0dc05c58380c11
MD5 bdb4cf7d01eca9d22afd93c36ddc58bc
BLAKE2b-256 4b914ad05bd8f1ccf7b2db690ca97c5998e05725afffea0a8ceda827c2c29da0

See more details on using hashes here.

File details

Details for the file viento-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: viento-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 52.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for viento-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 18629793b8ee673a25242163d48cca0c86ecc4e3f9c98aebaaed0b9bd7a69022
MD5 9540d3cea4710f1d2f13b760d8f81839
BLAKE2b-256 22a30f9f8386699d43b1275cb18eddd311c6f4793ba3a248238c622e57e5823f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page