RUST ยท GENERATIVE AI GATEWAY

open-generative-ai-rs โ€” Unified Multi-Provider Gateway & DAG Studio for 400+ AI Models

open-generative-ai-rs is a pure Rust orchestration gateway and web studio for chaining over 400 image, video, audio, and 3D generative AI models. It unifies local engines (sd.cpp, MLX, Wan2GP) and cloud providers behind a single type-safe Rust API with visual DAG workflow execution.

$ cargo install open-generative-ai-rs
GitHub โ†—
Interactive Demo

Embedded Web Studio & Generation Lab

This graphical studio is embedded directly inside the compiled binary and served via Axum at /studio.

STATUS: READY 0.00s
โšก
Live Engine Ready
Click any action on the left to trigger the generation simulator.
Rust CLI Command copy
open-genai generate image --model flux-dev --prompt "..."
Catalog Matrix

Supported Model Architectures

Full endpoint schemas, multi-aspect-ratio scaling, and local inference flags.

420+ Verified Models

FLUX.1 [dev]

Text-to-Image

Black Forest Labs 12B flow-matching transformer with photorealism and typographic fidelity.

Local sd.cpp: Yes $0.025 / run

Kling v3 Pro

Text-to-Video

Physics-accurate fluid dynamics, 1080p high bitrate rendering, and cinematic camera panning.

Max Duration: 10s $0.250 / run

Sora 2 Turbo

Text-to-Video

OpenAI video architecture with persistent world continuity and synchronized sound generation.

Audio Sync: Yes $0.400 / run

Wan 2.6 / 2.1 (Alibaba)

I2V & T2V

Open-weights 14B video foundation model. Executable via local Wan2GP Gradio server or cloud gateway.

Local Wan2GP: Free $0.120 / cloud

Infinite Talk I2V

Lip Sync

Speech-driven portrait animator synthesizing natural micro-expressions, blinks, and head tilt.

Audio Formats: MP3/WAV $0.090 / run

FLUX Kontext Pro

Image-to-Image

Up to 14 multi-image inputs for strict character consistency, style transfer, and virtual try-on.

Max Inputs: 14 images $0.045 / run
Performance Benchmarks

Rust Fork vs. Original Node/Next.js Stack

Comparing runtime efficiency, memory footprint, and deployment simplicity.

Metric Original (Next.js / Node) open-generative-ai-rs Performance Win
Binary Footprint ~550 MB (node_modules) 18 MB static binary 30ร— smaller
Cold Start Time 2.5s โ€“ 4.0s (V8 init) < 15 ms 200ร— faster
Idle Memory (RAM) 180 โ€“ 250 MB 11 MB 20ร— less RAM
Concurrency Architecture Single-threaded event loop Tokio work-stealing pool True CPU parallelism
Workflow Execution Client-side ReactFlow loop Native Rust DAG with Kahn's cycle check Deterministic & headless
Offline Test Mode Paid API calls required Built-in --mock provider Zero-cost CI/CD
Developer API

Axum REST Endpoints

Integrate Open Generative AI directly into Python, Go, Node, or shell scripts.

POST /api/v1/generate/image

Submit a text-to-image or image-to-image task and receive the completed asset URL.

curl -X POST http://127.0.0.1:8080/api/v1/generate/image \
  -H "Content-Type: application/json" \
  -d '{"model": "flux-dev", "prompt": "cyberpunk skyline", "aspect_ratio": "16:9"}'
POST /api/v1/workflows/run

Trigger a multi-step DAG pipeline (e.g. AI Influencer, Popcorn Storyboard) with variable passing.

curl -X POST http://127.0.0.1:8080/api/v1/workflows/run \
  -H "Content-Type: application/json" \
  -d '{"template_id": "ai-influencer", "inputs": {"prompt": "news anchor"}}'