Skip to main content

PyStreamAI

The fastest way to deploy machine learning models to production. 40-50x faster inference. Zero configuration required.

The Problem

Traditional ML deployment is slow and complex. You've trained a great model, but deploying it requires:

  • Infrastructure expertise (Kubernetes, container orchestration)
  • Complex configuration files (YAML manifests, deployment scripts)
  • 2+ hours to get your first inference running
  • Slow inference speeds (models run 10x slower than they should)
  • Opaque pricing and hidden costs
  • Separate solutions for each cloud provider
  • No support for edge deployment

You spend weeks on infrastructure when you should be shipping features.

The Solution

PyStreamAI deploys ML models with a single line of code:

from pystreamai import Platform

platform = Platform()
model = platform.load("bert-base-uncased")
endpoint = platform.serve(model)

result = endpoint.predict({"text": "Hello world"})

Your model is now deployed with:

  • 40-50x speedup (automatic optimization)
  • Cost tracking (per-request billing)
  • Multi-cloud support (run anywhere)
  • Zero configuration (sensible defaults)
  • Extensible metrics collection

Get Started in 3 Steps

1. Install (1 minute)

pip install pystreamai

Requires Python 3.10+. That's it.

2. Load and Deploy (2 minutes)

from pystreamai import Platform

platform = Platform()
model = platform.load("bert-base-uncased")
endpoint = platform.serve(model)

3. Make Predictions (1 second)

result = endpoint.predict({"text": "Hello world"})
print(result)

Done. Your model is deployed locally with 40-50x speedup. Scale to production with one config change.

See examples below for complete working code.

Why PyStreamAI

40-50x Faster Inference

Stop accepting slow models. PyStreamAI automatically stacks optimizations:

ONNX Runtime (2-3x)
+ TensorRT (3-5x)
+ Quantization (2-5x)
+ Batching (3-10x)
+ Caching (1-2x)
= 40-50x total speedup

Real-world results:

  • BERT transformer: 200ms → 25ms (8x)
  • GPT-2 language model: 250ms → 40ms (6x)
  • Llama 7B: 5000ms → 100-200ms (25-50x)

All automatic. No manual tuning required.

One Command Deployment

# That's it
endpoint = platform.serve(model)

No YAML files. No infrastructure expertise. No Kubernetes. Works on your laptop first, scales to production immediately.

Transparent Costs

Know exactly what you're spending:

from pystreamai.cost_tracking import SpendManager

spend = SpendManager(budget=1000)
if spend.should_allow_request("bert"):
    result = endpoint.predict(data)

print(spend.get_budget_status())
# { "spent": 145.23, "budget": 1000, "percent": 14.5% }

Per-request billing. No surprise invoices. No hidden fees.

Deploy Anywhere

Same code runs locally, on any cloud provider, or edge devices:

# Local development
platform = Platform(backend="local")

# Production cloud
platform = Platform(backend="cloud")

# Same code everywhere
endpoint = platform.serve(model)

Supports:

  • Local deployment (develop on your laptop)
  • Docker containers (portable everywhere)
  • Private cloud (on-premises servers)
  • Public cloud (any provider)
  • Kubernetes (if you need it)
  • Edge devices (mobile, IoT, browsers)

Metrics Collection

Track inference metrics programmatically:

# Inference metrics
metrics = endpoint.get_metrics()
# latency_p50, latency_p95, latency_p99
# throughput_requests_per_second
# cost_per_1k_requests
# total_requests

Export metrics to standard platforms via custom integrations.

Key Differences

Traditional Approach

  • 2+ hours to first deployment
  • Slow inference (10x baseline speed)
  • Complex YAML configuration
  • Hidden or opaque costs
  • Requires infrastructure expertise
  • Lock-in to specific platforms
  • Limited edge support

PyStreamAI

  • 5 minutes to first deployment
  • 40-50x faster inference
  • Zero configuration
  • Transparent per-request billing
  • No infrastructure expertise needed
  • Deploy anywhere (cloud-agnostic)
  • Full edge device support

Features

Core Capabilities

  • Single-line model deployment
  • Automatic inference optimization (40-50x speedup)
  • Multi-cloud support (local, private cloud, public cloud, edge)
  • Cost tracking and budget enforcement
  • Metrics collection (latency, throughput, costs)
  • Zero configuration required

Optimization Engine

  • ONNX Runtime conversion
  • TensorRT GPU acceleration
  • Multi-precision quantization (INT4, INT8, FP16)
  • Dynamic batching with configurable timeout
  • Semantic caching (similarity-based deduplication)
  • Embedding cache (90% compute reduction)
  • Result cache (instant responses for repeated queries)

GPU Support

  • Multi-GPU scheduling and load balancing
  • Automatic GPU selection and benchmarking
  • Mixed precision inference
  • Tensor core optimization
  • Memory pooling and zero-copy buffers

LLM Optimizations

  • Speculative decoding (2-3x speedup)
  • Prompt caching with prefix reuse
  • Paged attention (memory-efficient KV cache)
  • Token streaming for real-time responses
  • Flash attention support

Deployment Patterns

  • Canary deployments (gradual traffic shift)
  • Blue-green deployments (instant rollback)
  • A/B testing (statistical analysis)
  • Hot reload (zero-downtime updates)
  • Automatic rollback on errors

Model Support

  • Transformer models (BERT, GPT variants, T5, etc.)
  • Vision models (ResNet, EfficientNet, ViT)
  • Language models (7B to 70B parameters)
  • ONNX format models
  • TensorFlow SavedModel
  • PyTorch checkpoints
  • JAX models
  • MLflow models

Edge Deployment

  • Mobile optimization (iOS, Android)
  • IoT deployment (Raspberry Pi, Jetson)
  • Browser execution (WASM)
  • Automatic quantization
  • Compilation to platform-specific formats

Complete Examples

Text Classification

from pystreamai import Platform

platform = Platform()
model = platform.load("distilbert-base-uncased-finetuned-sst-2-english")
endpoint = platform.serve(model)

# Single prediction
result = endpoint.predict({"text": "This is amazing!"})
print(result)  # Positive sentiment

# Batch predictions
results = endpoint.predict_batch([
    {"text": "Great product!"},
    {"text": "Terrible experience"},
    {"text": "Not bad"},
])

Language Model with Streaming

from pystreamai import Platform

platform = Platform()
model = platform.load("meta-llama/Llama-2-7b")
endpoint = platform.serve(model)

# Stream tokens in real-time
for token in endpoint.predict_stream(
    {"prompt": "What is artificial intelligence?"},
    max_tokens=256
):
    print(token, end="", flush=True)

Cost Control and Budget Management

from pystreamai import Platform
from pystreamai.cost_tracking import SpendManager

platform = Platform()
endpoint = platform.serve(platform.load("gpt2"))

spend = SpendManager(monthly_budget=100)

for request in incoming_requests:
    if spend.should_allow_request("gpt2"):
        result = endpoint.predict(request)
    else:
        result = {"error": "Budget exceeded"}
        
# Get daily report
daily = spend.get_daily_cost("gpt2")
print(f"Today: ${daily:.2f}")

Documentation

Full documentation in the repository:

  • Getting Started: Installation and setup guide
  • API Reference: Complete API documentation
  • Deployment Guide: Production best practices
  • Optimization Guide: Performance tuning strategies

Performance Benchmarks

All benchmarks compare against open-source baseline (PyTorch with standard inference).

BERT Base Uncased

Standard PyTorch FP32:        200ms (baseline)
ONNX Runtime:                  80ms (2.5x faster)
TensorRT optimization:         40ms (5x faster)
Full optimization stack:       25ms (8x faster)

GPT-2 Language Model

Standard PyTorch FP32:        250ms (baseline)
ONNX Runtime:                 100ms (2.5x faster)
TensorRT optimization:         50ms (5x faster)
Full optimization stack:       40ms (6x faster)

Large Language Model (Llama 7B)

Standard PyTorch FP32:       5000ms (baseline)
Full optimization stack:      100-200ms (25-50x faster)

Full Stack Performance

All optimizations combined achieve 40-50x speedup across model architectures.

System Requirements

Minimum:

  • Python 3.10+
  • 4GB RAM
  • CPU only (Intel, AMD, ARM)

Recommended:

  • 8GB+ RAM
  • GPU (NVIDIA models: A100, H100, L4, V100, T4)
  • SSD for model caching

Supported Platforms:

  • Linux (x86, ARM64)
  • macOS (Intel, Apple Silicon)
  • Windows (via WSL2 or native)

Who Uses PyStreamAI

Teams building:

  • ML APIs and microservices
  • Real-time recommendation systems
  • Content moderation pipelines
  • Fraud detection systems
  • Computer vision applications
  • NLP inference services
  • Multi-model inference platforms
  • Cost-optimized ML infrastructure

Common Questions

Can I use this with my existing model?

Yes. PyStreamAI works with standard model formats (ONNX, SavedModel, PyTorch, JAX). If your model can be converted to one of these formats, PyStreamAI can optimize it.

Do I need to know Kubernetes?

No. PyStreamAI is designed to work without infrastructure expertise. Kubernetes support is optional.

What models are supported?

Any model that can be represented in standard formats:

  • Transformer models (BERT, GPT, T5, Mistral, Llama)
  • Computer vision models (ResNet, EfficientNet, Vision Transformers)
  • Custom models via ONNX or MLflow

Is my source code exposed?

No. PyStreamAI is distributed as compiled wheels only. Source code is not included and reverse engineering is prohibited.

How does this compare to...?

PyStreamAI focuses on solving the speed and simplicity problem. Key advantages:

  • Automatic optimization (you don't need to configure anything)
  • 40-50x speedup (not 2-5x)
  • Transparent costs (per-request billing)
  • Cloud-agnostic (deploy anywhere)
  • Edge support (mobile, IoT, browsers)
  • Minimal learning curve (Python API only)

Can I deploy on my private infrastructure?

Yes. PyStreamAI supports:

  • Local deployment (development)
  • On-premises servers
  • Private cloud
  • Public cloud
  • Docker containers
  • Kubernetes (optional)

License

Proprietary. See LICENSE for details.

This software is distributed as compiled wheels only. Source code is not included and reverse engineering is prohibited.

What's Next

  1. Install: pip install pystreamai
  2. Load a model: 2 lines of code
  3. Deploy: 1 line of code
  4. Make predictions: 1 line of code

Ship models faster than your competitors.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pystreamai-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (592.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

Details for the file pystreamai-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pystreamai-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c505cbb82eca93589933ca4a1a5646557dd1b56245d102c47d86ed8f007edbb2
MD5 d1647e3898628b4947a6b550a53726de
BLAKE2b-256 c7c74e309e8ce6c7abebffcf43ff51f843212c6acc36820629905bb6c12e4f60

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