NEPHIS (Python SDK)
Official Python SDK for NEPHIS Systems Fabric
Sub-6ms Hardware-Isolated MicroVM Sandboxes, Zero-Copy PostgreSQL Branching, and Bare-Metal Code Execution for Autonomous AI Agents.
⚡ What is Thanaton?
Thanaton is a high-performance execution engine built on Firecracker MicroVMs, Userfaultfd lazy memory paging, and cgroups v2 jailers. It allows AI agents and developers to boot full-featured Linux environments in single-digit milliseconds, execute untrusted code safely with KVM hardware isolation, and scale to zero at $0 idle cost.
Thanaton vs. The Competition
| Feature | Docker | E2B / Modal | AWS Lambda | Thanaton |
|---|---|---|---|---|
| Cold Boot Latency | 2s – 10s | 150ms – 400ms | 200ms – 1.5s | < 6.14ms (< 2ms with UFFD) ⚡ |
| Isolation Tier | Shared Host Kernel | Container Sandbox | MicroVM | Hardware KVM Hypervisor 🔒 |
| Scale-to-Zero ($0 Cost) | ❌ Memory tied up | ❌ Billed per second | ✅ (Stateless only) | ✅ Memory Snapshot (0 MB RAM) 💾 |
| Embedded PostgreSQL | ❌ Manual Dockerfile | ❌ None | ❌ None | ✅ Instant Bundled Postgres (10ms) 🗄️ |
| Dependency Footprint | Heavy Daemon | Heavy PyPI deps | AWS SDK bloat | ✅ Zero External Dependencies 🪶 |
🏆 Dual-Hardware Physical Benchmark Matrix (AWS Mumbai ap-south-1b)
Tested across bare-metal-equivalent AWS EC2 instances:
- Host 1 (AMD64):
c8i.large(Intel Xeon 6975P-C @ 3.8 GHz Turbo, 2 vCPUs, 4 GB RAM, Linux7.0.0-1014-aws) - Host 2 (ARM64):
c8g.large(AWS Graviton4 Neoverse-V2 @ 2.6 GHz, 2 vCPUs, 4 GB RAM, Linux7.0.0-1014-aws)
| Subsystem / Metric | Intel Xeon 6 (AMD64) | AWS Graviton4 (ARM64) | Physical Winner | Hardware Root Cause |
|---|---|---|---|---|
| Thanaton MicroVM Sandbox | 32.74 ms (Python 1M sum) | 39.96 ms | AMD64 (+18.1%) | Raw single-thread interpreter cycle throughput |
| Mnemon-DB 12 Reflink Clusters | 50.81 ms | 31.67 ms | ARM64 (+37.7%) | XFS extent allocation concurrency on NVMe |
| Eschaton Parallel Fan-Out | 38.2 ms (50 testcases) | 41.5 ms (50 testcases) | AMD64 (70x vs Judge0) | Bare-metal parallel worker fan-out vs sequential Docker |
| Hyperion Task Dispatch | 5,290,366 tasks/s | 3,052,964 tasks/s | AMD64 (+42.3%) | SCX eBPF ring buffer enqueue loop latency |
| Hyperion NVMe I/O QoS Clamping | 17 µs (96% drop) | 17 µs (96% drop) | Parity | Clamps rogue noisy-neighbor I/O from 3,850 µs to 155 µs |
| Acheron Stream Compression | 3,631.2 MB/s (Snappy) | 4,870.6 MB/s (LZ4) | ARM64 (+274.4%) | ARM NEON vector instruction throughput |
| Lethe DuckDB Columnar OLAP | 177.5M rows/s (1.32 GB/s) | 276.9M rows/s (2.06 GB/s) | ARM64 (+56.0%) | Graviton4 DDR5 memory bandwidth & vector registers |
🎁 Free Tier & Enterprise Deployment Models
- Free Alpha Tier: 10,000 free evaluation runs on our dedicated endpoint so you can benchmark your reasoning rollouts immediately.
- AWS Marketplace AMI: 1-click pre-baked AMI deployment directly into your private AWS VPC.
- On-Premise / BYOC (Bring Your Own Cloud): Deploy onto your own bare-metal servers or cloud VPC with zero external dependencies.
- Fully Managed Dedicated SaaS: High-availability cluster with sub-50ms execution SLA.
Direct Contact for All Upgrades, Custom AMIs & Enterprise Licensing:
Email:mohit@mohitrajdeo.in
📦 Installation
pip install nephis
Or install from source:
git clone https://github.com/MOHITRAJDEO12345/judge0-production-aws.git
cd judge0-production-aws/sdk/python
pip install -e .
🚀 Quickstart
1. Ephemeral Code Execution (One-Liner)
import thanaton
client = thanaton.Client()
result = client.run_code("""
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print("Mean:", arr.mean())
""", language="python")
print(result.stdout) # "Mean: 3.0"
print(f"Exit code: {result.exit_code}")
print(f"Executed in: {result.duration_ms}ms")
2. Context Manager with Embedded PostgreSQL
import thanaton
client = thanaton.Client(
base_url="http://127.0.0.1:8080",
api_key="thanaton_sec_..." # optional for authenticated SaaS
)
# Provision a 512MB MicroVM with an embedded PostgreSQL database
with client.sandboxes.create(runtime="microvm", memory_mb=512, with_db=True) as sbx:
print(f"Sandbox ID: {sbx.id} (Booted in {sbx.boot_duration_ms:.2f}ms)")
print(f"PostgreSQL URL: {sbx.db_url}")
# 1. Execute bash commands inside the MicroVM
res = sbx.exec("pip install -q pandas scikit-learn")
print("Pip stdout:", res.stdout)
# 2. Run SQL queries against the embedded database
sbx.sql("CREATE TABLE metrics (id SERIAL PRIMARY KEY, metric_name TEXT, score FLOAT);")
sbx.sql("INSERT INTO metrics (metric_name, score) VALUES ('accuracy', 0.985);")
rows = sbx.sql("SELECT * FROM metrics;")
print("Database Rows:", rows)
# 3. Scale to Zero (Hibernates to NVMe snapshot; 0% CPU, $0 idle RAM)
sbx.sleep()
print("Sandbox state:", sbx.state) # "sleeping"
# 4. Instant Wake (<2ms Userfaultfd restore)
sbx.wake()
print("Sandbox state:", sbx.state) # "running"
🤖 AI Agent Framework Integrations
CrewAI Integration
from crewai.tools import tool
import thanaton
client = thanaton.Client()
@tool("Thanaton MicroVM Sandbox")
def execute_code_safely(code: str, language: str = "python") -> str:
"""Execute arbitrary untrusted Python, Node, or Bash code in an isolated KVM MicroVM."""
res = client.run_code(code, language=language)
if res.ok:
return res.stdout
return f"Execution Error (exit {res.exit_code}):\n{res.stderr}"
LangChain Integration
from langchain_core.tools import tool
import thanaton
client = thanaton.Client()
@tool
def thanaton_code_executor(code: str) -> str:
"""Runs Python code safely in a sub-6ms Firecracker MicroVM."""
res = client.run_code(code, language="python")
return res.stdout or res.stderr
⚙️ Environment Variables
| Variable | Description | Default |
|---|---|---|
THANATON_API_URL |
Endpoint of the Thanaton Engine or Control Plane | http://127.0.0.1:8080 |
THANATON_API_KEY |
Bearer token for SaaS authorization | "" |
📄 License
Apache-2.0 © Thanaton Architecture Team
Metadata
Release files for nephis 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nephis-1.0.0.tar.gz | 76.0 kB | Without provenance | Details for nephis-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nephis-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for nephis-1.0.0-py3-none-any.whl |
Total release size: 164.4 kB
Release files / nephis-1.0.0.tar.gz
| Download URL | nephis-1.0.0.tar.gz |
|---|---|
| Size | 76.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b9c29214f423a2f3158815fc92812a6576e417f30ec4e7316a05772a16965f3
|
|
BLAKE2b-256 checksum How to use checksums |
f1b92bbbd7da768b771d9a16548b208afc4b11396a1786ea5d4766dec6a02af9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Release files / nephis-1.0.0-py3-none-any.whl
| Download URL | nephis-1.0.0-py3-none-any.whl |
|---|---|
| Size | 88.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aaf9de91f80939596ec94a7b997b28e23abaaa2074b9761ac3ce7dc170b634b2
|
|
BLAKE2b-256 checksum How to use checksums |
8763da4ee859abb6ecfaa3b898a13ea0a131ac08284ad9917ce131f8903046ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Security for nephis 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.