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.9.tar.gz (54.3 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.9-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viento-0.2.9.tar.gz
  • Upload date:
  • Size: 54.3 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.9.tar.gz
Algorithm Hash digest
SHA256 3d283551c6d2e49e6f41cb5749ae3b8058b6e0aeec2d2aa51b961e73b515bf93
MD5 56c99f98df81fe3b197df7c431eb92ae
BLAKE2b-256 f588336c3744b55a1a0a9a738255ae4a4a41819fd76df22c7183ca4707368add

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viento-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 52.5 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 fec236d181570699efd0d962549167a94df87d831b219075da2e01e256462764
MD5 5294253739ad8b0aab4277f89155b45f
BLAKE2b-256 56249717070a601a4dee2182b2969a9e45e200efab3984d4e6321d2f7ca1c138

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