viento 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- viento-0.2.0/LICENSE +21 -0
- viento-0.2.0/PKG-INFO +399 -0
- viento-0.2.0/README.md +340 -0
- viento-0.2.0/pyproject.toml +120 -0
- viento-0.2.0/setup.cfg +4 -0
- viento-0.2.0/setup.py +18 -0
- viento-0.2.0/tests/test_backends.py +133 -0
- viento-0.2.0/tests/test_ollama_adapter.py +101 -0
- viento-0.2.0/tests/test_protocol.py +157 -0
- viento-0.2.0/tests/test_sdk.py +189 -0
- viento-0.2.0/tests/test_telemetry.py +162 -0
- viento-0.2.0/viento/__init__.py +34 -0
- viento-0.2.0/viento/backends/__init__.py +45 -0
- viento-0.2.0/viento/backends/base.py +122 -0
- viento-0.2.0/viento/backends/llamacpp.py +242 -0
- viento-0.2.0/viento/backends/ollama.py +249 -0
- viento-0.2.0/viento/backends/vllm.py +234 -0
- viento-0.2.0/viento/cli/__init__.py +7 -0
- viento-0.2.0/viento/cli/main.py +545 -0
- viento-0.2.0/viento/client/__init__.py +7 -0
- viento-0.2.0/viento/client/client.py +463 -0
- viento-0.2.0/viento/config/__init__.py +7 -0
- viento-0.2.0/viento/config/defaults.py +221 -0
- viento-0.2.0/viento/config/loader.py +136 -0
- viento-0.2.0/viento/connection/__init__.py +7 -0
- viento-0.2.0/viento/connection/manager.py +484 -0
- viento-0.2.0/viento/protocol/__init__.py +57 -0
- viento-0.2.0/viento/protocol/envelope.py +265 -0
- viento-0.2.0/viento/protocol/validator.py +220 -0
- viento-0.2.0/viento/py.typed +1 -0
- viento-0.2.0/viento/scheduler/__init__.py +7 -0
- viento-0.2.0/viento/scheduler/scheduler.py +346 -0
- viento-0.2.0/viento/telemetry/__init__.py +23 -0
- viento-0.2.0/viento/telemetry/benchmarks.py +114 -0
- viento-0.2.0/viento/telemetry/collector.py +267 -0
- viento-0.2.0/viento/telemetry/logging.py +183 -0
- viento-0.2.0/viento.egg-info/PKG-INFO +399 -0
- viento-0.2.0/viento.egg-info/SOURCES.txt +40 -0
- viento-0.2.0/viento.egg-info/dependency_links.txt +1 -0
- viento-0.2.0/viento.egg-info/entry_points.txt +2 -0
- viento-0.2.0/viento.egg-info/requires.txt +32 -0
- viento-0.2.0/viento.egg-info/top_level.txt +1 -0
viento-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zephyr Cloud Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
viento-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: viento
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Viento: Distributed AI inference runtime SDK — connect your local LLMs to the cloud mesh
|
|
5
|
+
Author-email: Zephyr Cloud Team <indrohelpdesk@gmail.com>
|
|
6
|
+
Maintainer-email: Zephyr Cloud Team <indrohelpdesk@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/ZephyrCloud-AI/viento
|
|
9
|
+
Project-URL: Documentation, https://github.com/ZephyrCloud-AI/viento/tree/main/docs
|
|
10
|
+
Project-URL: Repository, https://github.com/ZephyrCloud-AI/viento
|
|
11
|
+
Project-URL: Bug Tracker, https://github.com/ZephyrCloud-AI/viento/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/ZephyrCloud-AI/viento/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: llm,ai,inference,ollama,distributed,runtime,zephyr,edge-computing,openai-compatible,vllm,llama-cpp
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
27
|
+
Classifier: Typing :: Typed
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: pydantic>=2.0.0
|
|
32
|
+
Requires-Dist: httpx>=0.24.0
|
|
33
|
+
Requires-Dist: psutil>=5.9.0
|
|
34
|
+
Requires-Dist: websockets>=11.0
|
|
35
|
+
Requires-Dist: click>=8.0.0
|
|
36
|
+
Requires-Dist: rich>=13.0.0
|
|
37
|
+
Requires-Dist: tomli>=2.0.0; python_version < "3.11"
|
|
38
|
+
Requires-Dist: tomli-w>=1.0.0
|
|
39
|
+
Requires-Dist: typing-extensions>=4.0.0; python_version < "3.11"
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
42
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
43
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
|
|
44
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
45
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
46
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
47
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
48
|
+
Requires-Dist: httpx>=0.24.0; extra == "dev"
|
|
49
|
+
Provides-Extra: test
|
|
50
|
+
Requires-Dist: pytest>=7.0.0; extra == "test"
|
|
51
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
|
|
52
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "test"
|
|
53
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
|
|
54
|
+
Provides-Extra: docs
|
|
55
|
+
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
|
|
56
|
+
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
|
|
57
|
+
Requires-Dist: mkdocstrings[python]>=0.23.0; extra == "docs"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
<div align="center">
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
__ __ .___ ___________ _______ ___________ ________
|
|
64
|
+
/ \ / \ | | \_ _____/ \ \ \__ ___/ \_____ \
|
|
65
|
+
\ \/\/ / | | | __)_ / | \ | | / | \
|
|
66
|
+
\ / | | | \ / | \ | | / | \
|
|
67
|
+
\__/\ / |___| /_______ / \____|__ / |____| \_______ /
|
|
68
|
+
\/ \/ \/ \/
|
|
69
|
+
|
|
70
|
+
Distributed AI Inference · Edge-to-Cloud · Open Source
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
<h1>Viento SDK</h1>
|
|
74
|
+
|
|
75
|
+
<p>
|
|
76
|
+
<strong>Run your local LLMs. Connect to the cloud mesh. Serve the world.</strong>
|
|
77
|
+
</p>
|
|
78
|
+
|
|
79
|
+
[](https://pypi.org/project/viento/)
|
|
80
|
+
[](https://pypi.org/project/viento/)
|
|
81
|
+
[](LICENSE)
|
|
82
|
+
[](tests/)
|
|
83
|
+
[](https://github.com/psf/black)
|
|
84
|
+
[](https://github.com/ZephyrCloud-AI/viento)
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ⚡ What is Zephyr?
|
|
91
|
+
|
|
92
|
+
**Zephyr** is a production-grade distributed inference runtime. It lets you take your local GPU/CPU machine running [Ollama](https://ollama.ai), [llama.cpp](https://github.com/ggerganov/llama.cpp), or [vLLM](https://github.com/vllm-project/vllm) and plug it into the Zephyr Cloud mesh — instantly turning it into a globally-addressable AI inference node.
|
|
93
|
+
|
|
94
|
+
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.
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Your Machine (GPU/CPU) Zephyr Cloud Gateway Your Users
|
|
98
|
+
──────────────────── ──────────────────── ────────────
|
|
99
|
+
Ollama llama3:latest ◄─WSS─► zephyr.onrender.com ◄─HTTPS─► API Clients
|
|
100
|
+
llama.cpp phi3 secure job routing & OpenAI-compatible
|
|
101
|
+
vLLM mistral tunnel load balancing SDK / curl / apps
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 🚀 Installation
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pip install viento
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Or install from source for the latest unreleased features:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
git clone https://github.com/ZephyrCloud-AI/viento.git
|
|
116
|
+
cd viento/SDK
|
|
117
|
+
pip install -e ".[dev]"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Requirements:** Python ≥ 3.9 · [Ollama](https://ollama.ai) (recommended) or llama.cpp / vLLM
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 🖥 CLI Reference
|
|
125
|
+
|
|
126
|
+
### Start Your Node
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
viento run
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Boots the runtime, connects to `wss://zephyr.onrender.com/ws/runtime`, performs the HELLO→WELCOME→REGISTER→SESSION_READY handshake, and begins receiving jobs. On success, your terminal displays:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
136
|
+
║ ⚡ ZEPHYR NODE AUTHENTICATED ⚡ ║
|
|
137
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
138
|
+
║ Session ID : zph_sess_8f9a12c4 ║
|
|
139
|
+
║ API Key : zph_tmp_8f9a2b4c... (1-hour TTL) ║
|
|
140
|
+
║ Models : llama3:latest, phi3:mini, mistral:7b ║
|
|
141
|
+
║ Backend : Ollama @ http://localhost:11434 ║
|
|
142
|
+
║ Status : 🟢 Online — awaiting jobs ║
|
|
143
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### All Commands
|
|
147
|
+
|
|
148
|
+
| Command | Description |
|
|
149
|
+
|---------|-------------|
|
|
150
|
+
| `viento run` | Start the runtime node and connect to cloud |
|
|
151
|
+
| `viento run --server wss://...` | Connect to a custom gateway |
|
|
152
|
+
| `viento run --concurrency 4` | Override max concurrent jobs |
|
|
153
|
+
| `viento status` | Show session, TTL, active jobs, and metrics |
|
|
154
|
+
| `viento models` | List all locally discovered models |
|
|
155
|
+
| `viento pull llama3:latest` | Pull model weights via Ollama |
|
|
156
|
+
| `viento doctor` | Diagnose Ollama, GPU, RAM, and network |
|
|
157
|
+
| `viento config view` | View current configuration |
|
|
158
|
+
| `viento config set <key> <value>` | Update a config value |
|
|
159
|
+
| `viento stop` | Gracefully drain jobs and disconnect |
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 🐍 Python Client Usage
|
|
164
|
+
|
|
165
|
+
### Synchronous Chat
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
from viento.client.client import VientoClient
|
|
169
|
+
|
|
170
|
+
client = VientoClient(
|
|
171
|
+
base_url="https://zephyr.onrender.com",
|
|
172
|
+
api_key="zph_tmp_your_session_key",
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
response = client.chat.completions.create(
|
|
176
|
+
model="llama3:latest",
|
|
177
|
+
messages=[
|
|
178
|
+
{"role": "system", "content": "You are a helpful assistant."},
|
|
179
|
+
{"role": "user", "content": "Explain quantum entanglement."},
|
|
180
|
+
],
|
|
181
|
+
temperature=0.7,
|
|
182
|
+
max_tokens=512,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
print(response.choices[0].message.content)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Streaming (Real-Time Tokens)
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
stream = client.chat.completions.create(
|
|
192
|
+
model="llama3:latest",
|
|
193
|
+
messages=[{"role": "user", "content": "Write a haiku about distributed systems."}],
|
|
194
|
+
stream=True,
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
for chunk in stream:
|
|
198
|
+
print(chunk.choices[0].delta.content, end="", flush=True)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Async Client
|
|
202
|
+
|
|
203
|
+
```python
|
|
204
|
+
import asyncio
|
|
205
|
+
from viento.client.client import AsyncVientoClient
|
|
206
|
+
|
|
207
|
+
async def main():
|
|
208
|
+
client = AsyncVientoClient(api_key="zph_tmp_...")
|
|
209
|
+
response = await client.chat.completions.create(
|
|
210
|
+
model="phi3:latest",
|
|
211
|
+
messages=[{"role": "user", "content": "Hello, Zephyr!"}],
|
|
212
|
+
)
|
|
213
|
+
print(response.choices[0].message.content)
|
|
214
|
+
|
|
215
|
+
asyncio.run(main())
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Embeddings
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
result = client.embeddings.create(
|
|
222
|
+
model="all-minilm:latest",
|
|
223
|
+
input=["The quick brown fox", "jumps over the lazy dog"],
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
for i, embedding in enumerate(result.data):
|
|
227
|
+
print(f"Input {i}: {len(embedding.embedding)}-dim vector")
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 🏗 Architecture
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
┌─────────────────────────────────────────┐
|
|
236
|
+
│ Zephyr Cloud Gateway │
|
|
237
|
+
│ wss://zephyr.onrender.com │
|
|
238
|
+
│ │
|
|
239
|
+
│ ┌──────────┐ ┌──────────────────────┐ │
|
|
240
|
+
│ │ API GW │ │ RuntimeManager │ │
|
|
241
|
+
│ │ /v1/chat │ │ - Session Registry │ │
|
|
242
|
+
│ │ /v1/emb │ │ - Job Routing │ │
|
|
243
|
+
│ │ /v1/models│ │ - Heartbeat Monitor │ │
|
|
244
|
+
│ └──────────┘ └──────────────────────┘ │
|
|
245
|
+
└──────────────────┬──────────────────────┘
|
|
246
|
+
│
|
|
247
|
+
WSS · ProtocolEnvelope v1.0
|
|
248
|
+
(HELLO/WELCOME/REGISTER/JOB/...)
|
|
249
|
+
│
|
|
250
|
+
┌─────────────────────────────▼───────────────────────────────┐
|
|
251
|
+
│ Zephyr Edge Node │
|
|
252
|
+
│ │
|
|
253
|
+
│ ┌─────────────────────┐ ┌───────────────────────────┐ │
|
|
254
|
+
│ │ ConnectionManager │────►│ JobScheduler │ │
|
|
255
|
+
│ │ ▸ WSS Client │ │ ▸ FIFO async queue │ │
|
|
256
|
+
│ │ ▸ Exponential BO │ │ ▸ Semaphore concurrency │ │
|
|
257
|
+
│ │ ▸ Heartbeat 15s │ │ ▸ ExecutionHandle cancel │ │
|
|
258
|
+
│ │ ▸ Seq. Validation │ │ ▸ State machine (6 states│ │
|
|
259
|
+
│ └──────────┬──────────┘ └────────────┬──────────────┘ │
|
|
260
|
+
│ │ │ │
|
|
261
|
+
│ ┌──────────▼──────────┐ ┌────────────▼──────────────┐ │
|
|
262
|
+
│ │ ConfigManager │ │ Inference Backends │ │
|
|
263
|
+
│ │ ~/.viento/ │ │ ▸ OllamaAdapter │ │
|
|
264
|
+
│ │ config.toml │ │ ▸ LlamaCppAdapter │ │
|
|
265
|
+
│ │ runtime.json │ │ ▸ VLLMAdapter │ │
|
|
266
|
+
│ └─────────────────────┘ └───────────────────────────┘ │
|
|
267
|
+
│ │
|
|
268
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
269
|
+
│ │ TelemetryCollector │ │
|
|
270
|
+
│ │ CPU · RAM · GPU VRAM · Latency Histograms · Logs │ │
|
|
271
|
+
│ └──────────────────────────────────────────────────────┘ │
|
|
272
|
+
└─────────────────────────────────────────────────────────────┘
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Core Components
|
|
276
|
+
|
|
277
|
+
| Component | Location | Role |
|
|
278
|
+
|-----------|----------|------|
|
|
279
|
+
| `ConnectionManager` | `viento/connection/manager.py` | WSS supervisor, handshake, heartbeat, reconnect |
|
|
280
|
+
| `JobScheduler` | `viento/scheduler/scheduler.py` | FIFO queue, semaphore, cancellation state machine |
|
|
281
|
+
| `OllamaAdapter` | `viento/backends/ollama.py` | NDJSON streaming, TCP-abort cancellation |
|
|
282
|
+
| `LlamaCppAdapter` | `viento/backends/llamacpp.py` | llama.cpp server v1/chat/completions |
|
|
283
|
+
| `VLLMAdapter` | `viento/backends/vllm.py` | vLLM OpenAI-compat endpoint |
|
|
284
|
+
| `ProtocolEnvelope` | `viento/protocol/envelope.py` | Canonical WSS framing (v1.0) |
|
|
285
|
+
| `TelemetryCollector` | `viento/telemetry/collector.py` | Hardware stats + latency histograms |
|
|
286
|
+
| `ConfigManager` | `viento/config/loader.py` | Persistent config, secure key stripping |
|
|
287
|
+
| `VientoClient` | `viento/client/client.py` | OpenAI-compatible Python client |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## 📁 Repository Structure
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
SDK/
|
|
295
|
+
├── 📄 pyproject.toml ← Package metadata & tooling
|
|
296
|
+
├── 📄 README.md ← This file
|
|
297
|
+
├── 📄 CHANGELOG.md ← Release history
|
|
298
|
+
├── 📄 CONTRIBUTING.md ← Contribution guide
|
|
299
|
+
├── 📄 CODE_OF_CONDUCT.md ← Community standards
|
|
300
|
+
│
|
|
301
|
+
├── 📂 viento/ ← Main package source
|
|
302
|
+
│ ├── 📄 __init__.py
|
|
303
|
+
│ ├── 📂 backends/ ← Inference engine adapters
|
|
304
|
+
│ │ ├── 📄 base.py ← Abstract base + handles
|
|
305
|
+
│ │ ├── 📄 ollama.py ← Ollama REST adapter
|
|
306
|
+
│ │ ├── 📄 llamacpp.py ← llama.cpp adapter
|
|
307
|
+
│ │ └── 📄 vllm.py ← vLLM adapter
|
|
308
|
+
│ ├── 📂 cli/ ← CLI commands
|
|
309
|
+
│ │ ├── 📄 main.py ← Click group entry point
|
|
310
|
+
│ │ └── 📄 commands.py ← run, status, models, pull ...
|
|
311
|
+
│ ├── 📂 client/ ← Python SDK client
|
|
312
|
+
│ │ └── 📄 client.py ← VientoClient / AsyncVientoClient
|
|
313
|
+
│ ├── 📂 config/ ← Config & state management
|
|
314
|
+
│ │ └── 📄 loader.py ← ConfigManager, RuntimeState
|
|
315
|
+
│ ├── 📂 connection/ ← WebSocket supervisor
|
|
316
|
+
│ │ └── 📄 manager.py ← ConnectionManager
|
|
317
|
+
│ ├── 📂 protocol/ ← Wire protocol engine
|
|
318
|
+
│ │ ├── 📄 envelope.py ← Pydantic envelope models
|
|
319
|
+
│ │ └── 📄 validator.py ← Sequence tracking & validation
|
|
320
|
+
│ ├── 📂 scheduler/ ← Job queue and executor
|
|
321
|
+
│ │ └── 📄 scheduler.py ← JobScheduler (6-state machine)
|
|
322
|
+
│ └── 📂 telemetry/ ← Observability layer
|
|
323
|
+
│ ├── 📄 collector.py ← Hardware + latency metrics
|
|
324
|
+
│ └── 📄 logging.py ← JSON logger with secret masking
|
|
325
|
+
│
|
|
326
|
+
├── 📂 tests/ ← Test suite (47 tests, 100% pass)
|
|
327
|
+
│ ├── 📄 test_backends.py
|
|
328
|
+
│ ├── 📄 test_ollama_adapter.py
|
|
329
|
+
│ ├── 📄 test_protocol.py
|
|
330
|
+
│ ├── 📄 test_sdk.py
|
|
331
|
+
│ └── 📄 test_telemetry.py
|
|
332
|
+
│
|
|
333
|
+
└── 📂 docs/ ← Extended documentation
|
|
334
|
+
├── 📄 architecture.md
|
|
335
|
+
├── 📄 cli_guide.md
|
|
336
|
+
└── 📄 ollama_integration_guide.md
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## 🔐 Security Design
|
|
342
|
+
|
|
343
|
+
- **No secrets on disk:** Active API keys (`zph_tmp_...`) are kept only in process memory. The `RuntimeState` model strips keys before any disk write.
|
|
344
|
+
- **TLS by default:** All cloud connections use `wss://` (WebSocket Secure).
|
|
345
|
+
- **Secret masking in logs:** The `SecretMasker` regex masks any `zph_tmp_...` pattern in structured logs.
|
|
346
|
+
- **Sequence validation:** The `SequenceTracker` detects replay attacks and packet reordering in both directions.
|
|
347
|
+
- **Connection isolation:** Each WSS session uses a unique `session_id`; unauthorized frame injection is rejected at the envelope level.
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## 🧪 Testing
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
# Install dev dependencies
|
|
355
|
+
pip install -e ".[dev]"
|
|
356
|
+
|
|
357
|
+
# Run full test suite
|
|
358
|
+
pytest tests/ -v
|
|
359
|
+
|
|
360
|
+
# Run with coverage
|
|
361
|
+
pytest tests/ --cov=viento --cov-report=html
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**Test Coverage Summary:**
|
|
365
|
+
|
|
366
|
+
| Module | Tests |
|
|
367
|
+
|--------|-------|
|
|
368
|
+
| Backend Adapters (Ollama, llama.cpp, vLLM) | 14 tests |
|
|
369
|
+
| Protocol Envelopes & Sequence Tracking | 16 tests |
|
|
370
|
+
| Scheduler, Config, Connection, Client | 9 tests |
|
|
371
|
+
| Telemetry & Logging | 8 tests |
|
|
372
|
+
| **Total** | **47 tests · 100% passing** |
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## 🤝 Contributing
|
|
377
|
+
|
|
378
|
+
We welcome contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
|
|
379
|
+
|
|
380
|
+
1. Fork the repository
|
|
381
|
+
2. Create a feature branch: `git checkout -b feat/amazing-feature`
|
|
382
|
+
3. Run the tests: `pytest tests/`
|
|
383
|
+
4. Push and open a Pull Request
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## 📜 License
|
|
388
|
+
|
|
389
|
+
MIT License © 2026 Zephyr Cloud Team. See [LICENSE](../LICENSE) for details.
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
<div align="center">
|
|
394
|
+
|
|
395
|
+
Made with ⚡ by the Zephyr Cloud team.
|
|
396
|
+
|
|
397
|
+
[⭐ Star us on GitHub](https://github.com/ZephyrCloud-AI/viento) · [📦 PyPI Package](https://pypi.org/project/viento/) · [🐛 Report a Bug](https://github.com/ZephyrCloud-AI/viento/issues)
|
|
398
|
+
|
|
399
|
+
</div>
|