Skip to main content

High-Performance Traffic Shadowing & Experimentation Platform

Project description

UniverseOS

High-Performance Traffic Shadowing & Experimentation Platform

Status: Alpha – Suitable for staging / non-critical use. Ideal Users: Infra / Platform teams who want to shadow new models or prompts on real traffic.

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.
  • Streaming Support: For streaming responses (e.g., LLM tokens), the Gateway forwards the primary stream to the client in real time while consuming the shadow stream in the background and logging it, without impacting user latency.
  • 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.

Quickstart

1. Deploy the Control Plane

The core infrastructure runs as a set of containerized services.

docker-compose up -d

2. Configure Your Universes

Create a universe.yaml file to define your primary and shadow models:

primary:
  id: "openai-gpt4"
  provider: "openai"
  model: "gpt-4"

shadow_universes:
  - id: "internal-v2"
    provider: "rest"
    endpoint: "http://internal-llm-v2:8000/chat"

policy:
  sample_rate: 1.0

3. Install the Python SDK

For Python applications, the SDK provides a seamless integration point.

pip install universeos

4. 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):
    # After adding this decorator, every call to generate_response()
    # will be mirrored to your configured shadow universes via UniverseOS.
    return production_client.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": prompt}]
    )

See examples/fastapi_demo/ on the homepage repo for a full end-to-end example (docker-compose + OpenAI GPT-4 + shadow model).

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

universeos-0.1.3.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

universeos-0.1.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file universeos-0.1.3.tar.gz.

File metadata

  • Download URL: universeos-0.1.3.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for universeos-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0d1b720281d509aa040c22c40e1a77c9b8d7c762b95bc600b6fcd6cbe9bf3e1d
MD5 6e912485325550c912902fda8a891cb1
BLAKE2b-256 2b342d36be15fdfec958905fd3f4adbc3fae83f9f42321c762dd479215ffef51

See more details on using hashes here.

File details

Details for the file universeos-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: universeos-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for universeos-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7d5756d361aec327ee77860ce8f235a606640b9dcb757dcec11e576143d4e385
MD5 50082854dae6c1487564018ba9f5afe3
BLAKE2b-256 03f8b00066c86520e2823c60d24b4df679ea32209e3cf04778e7cc4335af89e9

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 Pingdom Monitoring Sentry Error logging StatusPage Status page