Skip to content

Universal open standard for compute sandboxes - Protocol-first, production-ready API for E2B, Modal, Vercel, Cloudflare & more

Notifications You must be signed in to change notification settings

nibzard/openruntime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenRuntime

The Universal Open Standard for Compute Sandboxes

OpenRuntime is a protocol-first, polyglot, production-ready standard for compute sandboxes that works everywhere—from browsers to Kubernetes clusters.

Why OpenRuntime?

Current sandbox solutions are fragmented across languages and providers. OpenRuntime provides:

  • 🌐 Universal Protocol: OpenRPC-based JSON-RPC 2.0 standard
  • 🔌 Provider Agnostic: Works with E2B, Modal, Daytona, Cloudflare, Vercel, custom providers
  • 🚀 Production Ready: Built-in pooling, retry, circuit breakers
  • 📊 Observable: Native OpenTelemetry integration
  • 💰 Cost Aware: Automatic cost optimization and routing
  • 🔒 Secure: mTLS, secret masking, audit logging
  • 🎯 Type Safe: Generated SDKs for Python, TypeScript, Go, Rust

Architecture

┌─────────────────────────────────────────────────────────┐
│ Application Layer                                       │
│ Next.js, Django, CLI, Jupyter, VS Code Extensions      │
└─────────────────────┬───────────────────────────────────┘
                      │
┌─────────────────────▼───────────────────────────────────┐
│ SDK Layer (Auto-Generated)                              │
│ Python, TypeScript, Go, Rust, Java                     │
└─────────────────────┬───────────────────────────────────┘
                      │
┌─────────────────────▼───────────────────────────────────┐
│ Control Plane (Go Reference Server)                     │
│ Routing, Pooling, Cost Optimizer, Observability        │
└─────────────────────┬───────────────────────────────────┘
                      │
┌─────────────────────▼───────────────────────────────────┐
│ Provider Adapters (WebAssembly Plugins)                 │
│ E2B, Modal, Vercel, Custom Providers                   │
└─────────────────────────────────────────────────────────┘

Quick Start

Install SDK

# Python
pip install openruntime

# TypeScript
npm install openruntime

Basic Usage

from openruntime import Runtime

# Auto-discovers best provider based on requirements
async with Runtime.create(
    runtime="python",
    features=["filesystem"],
    max_cost_per_hour=0.50
) as sandbox:
    result = await sandbox.execute("print('Hello, OpenRuntime!')")
    print(result.stdout)
import { createRuntime } from 'openruntime';

const sandbox = await createRuntime({
  runtime: 'node',
  features: ['filesystem', 'network'],
  maxCostPerHour: 0.50
});

const result = await sandbox.execute("console.log('Hello, OpenRuntime!')");
console.log(result.stdout);

Features

Capability Negotiation

OpenRuntime automatically selects the best provider based on your requirements:

sandbox = await Runtime.create(
    runtime="python",
    min_memory_gb=4,
    features_required=["filesystem", "terminal"],
    features_optional=["gpu"],
    constraints={
        "max_cost_per_hour": 0.50,
        "preferred_regions": ["us-east-1"],
        "min_availability_sla": 99.9
    }
)

Connection Pooling

Built-in connection pooling with LRU eviction and TTL:

pool = await RuntimePool.create(
    min_idle=2,
    max_total=10,
    idle_timeout=600,
    ttl=3600,
    template="python:3.11-ml"
)

sandbox = await pool.acquire(labels={"session": "user_123"})
# ... use sandbox ...
await pool.release(sandbox)

Retry & Circuit Breakers

Production-grade resilience patterns:

runtime = Runtime(
    retry=RetryConfig(
        max_attempts=3,
        exponential_base=2.0,
        jitter=True
    ),
    circuit_breaker=CircuitBreakerConfig(
        failure_threshold=5,
        recovery_timeout=60
    )
)

Observability

Native OpenTelemetry integration:

# Automatic traces, metrics, and logs
sandbox = await Runtime.create(runtime="python")

# Traces include:
# - runtime.provider = "e2b"
# - runtime.region = "us-east-1"
# - runtime.cost_per_hour = 0.35

# Metrics include:
# - runtime_sandbox_create_duration_seconds
# - runtime_sandbox_active_count
# - runtime_execution_errors_total
# - runtime_cost_total_usd

Project Structure

openruntime/
├── spec/                    # OpenRPC specification
│   ├── openruntime.json    # Main protocol spec
│   └── capabilities/       # Capability schemas
├── server/                 # Go reference server
│   ├── cmd/               # CLI entrypoint
│   ├── internal/          # Core implementation
│   └── plugins/           # Provider adapters
├── sdk/                   # Auto-generated SDKs
│   ├── python/
│   ├── typescript/
│   └── go/
├── providers/             # Provider adapter examples
│   ├── e2b/
│   ├── modal/
│   └── template/
└── docs/                  # Documentation

Roadmap

Phase 1: Core Protocol (Q1 2025)

  • OpenRPC specification
  • Go reference server
  • Provider adapter framework
  • E2B + Modal adapters

Phase 2: Multi-Language SDKs (Q2 2025)

  • Python SDK (auto-generated)
  • TypeScript SDK (auto-generated)
  • Framework integrations (Next.js, Django, FastAPI)

Phase 3: Ecosystem (Q3-Q4 2025)

  • Provider marketplace
  • Cost optimizer
  • Enterprise features (RBAC, SSO, audit)
  • Cross-provider migration tools

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE for details.

Community


Built with ❤️ by the open-source community

About

Universal open standard for compute sandboxes - Protocol-first, production-ready API for E2B, Modal, Vercel, Cloudflare & more

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages