Real-Time LLM Traffic Shadowing Platform SDK
Project description
UniverseOS
High-Performance Traffic Shadowing & Experimentation Platform
UniverseOS is a specialized infrastructure layer designed for safe, real-time experimentation with production traffic. While currently optimized for Large Language Models (LLMs), its core architecture provides a generic, high-concurrency shadowing gateway that enables "Parallel Universe" testing—allowing engineers to validate new models, prompts, or configurations against live production data with zero impact on end-user latency or reliability.
Core Architecture
UniverseOS is built on a split-plane architecture designed for scale and resilience:
- Data Plane (C++ Gateway): A high-performance, non-blocking reverse proxy written in C++. It utilizes asynchronous I/O to handle high throughput with minimal overhead. The Gateway intercepts incoming requests and mirrors them to shadow backends asynchronously, ensuring the primary response path remains unaffected.
- Control Plane (Registry & Policy): A dynamic service discovery and routing engine. It allows for hot-swapping of shadow models and granular traffic routing policies (e.g., "shadow 10% of traffic to Model B") without restarting the gateway.
- Observability Plane: A dedicated metrics ingestion pipeline that captures latency, throughput, and model-specific telemetry (e.g., token usage) for side-by-side performance comparison.
Key Features
- Zero-Latency Shadowing: The shadowing mechanism is completely decoupled from the primary request path. Shadow responses are processed out-of-band, guaranteeing no latency penalty for the end user.
- Language Agnostic Integration: Designed as a network-level infrastructure component. While a Python SDK is provided for convenience, the system works with any client capable of making HTTP requests.
- Production Safety: Failures in shadow models are isolated. If a shadow model crashes or times out, the primary request completes successfully, and the error is logged for analysis.
- Live A/B Testing & Evaluation: Facilitates "dark launching" of new models. Compare the quality and cost of a new model against the production baseline using real-world inputs before exposing it to users.
Quickstart
1. Deploy the Control Plane
The core infrastructure runs as a set of containerized services.
docker-compose up -d
2. Install the Python SDK
For Python applications, the SDK provides a seamless integration point.
pip install universeos
3. Integration
Wrap your existing API calls to enable automatic shadowing. The SDK handles the communication with the Gateway.
from universeos import universe_shadow, init_universe
# Initialize connection to the sidecar/gateway
init_universe()
@universe_shadow
def generate_response(prompt):
# Your existing production logic (e.g., OpenAI, Anthropic, or local LLM)
return production_client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": prompt}]
)
Technical Specifications
- Gateway: C++17, Asynchronous Socket I/O (poll/epoll)
- Protocol: HTTP/1.1 (Streaming Support)
- Configuration: Dynamic YAML-based policy loading
- SDK: Python 3.7+ (Thread-safe, minimal dependencies)
Building from Source
To build the high-performance Gateway and Control Plane services from source:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
Project details
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 universeos-0.1.1.tar.gz.
File metadata
- Download URL: universeos-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17c9607587ac95206416581b97c2e2556cab2102fc1107e242590f680b27c306
|
|
| MD5 |
1632432761bd4b35c170afec0c4c5010
|
|
| BLAKE2b-256 |
e622d63f6887af055a0e2d6d31e00d962dd8f1f90ebb948d9fbfc907025e4c3c
|
File details
Details for the file universeos-0.1.1-py3-none-any.whl.
File metadata
- Download URL: universeos-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aff7b203cbcd72b5ed9d734f49472859fb826eccd217d653d593ad11680da3cc
|
|
| MD5 |
fd658db46f855eb9a8f42c4b400c56e4
|
|
| BLAKE2b-256 |
a474dcbed9c78bad97e489b9439b15f0a0b5b4ba41886c9643f874ac668d5696
|