Skip to content

Latest commit

 

History

History
289 lines (189 loc) · 17.3 KB

File metadata and controls

289 lines (189 loc) · 17.3 KB

stdapi.ai Deployment Examples

Production-ready Terraform examples for deploying stdapi.ai — an OpenAI, Anthropic, Cohere & Ollama compatible API gateway that runs in your own AWS account, in front of Amazon Bedrock and the AWS AI services (Polly, Transcribe, Comprehend). Not just chat: images, video, audio, files, embeddings, moderation and reranking. 14-day free trial included.

Start 14-Day Free Trial · Documentation · GitHub Repository


Available Examples

Single-region production deployment with hardened security defaults and optional monitoring.

Perfect for getting started with production workloads. Includes everything needed for secure, scalable deployment in a single AWS region.

Key Features:

  • HTTPS on your own domain, with the ACM certificate and Route53 records created for you
  • Auto-scaling (CPU, Memory, Request-based)
  • KMS encryption for all data at rest
  • API key authentication
  • Optional WAF protection and CloudWatch alarms

Best for: Most production workloads, quick deployment, single-region requirements


EU multi-region deployment with EU data residency controls.

Deployment that keeps model processing within the EU regions you enable. Eligible failures retry in another enabled EU region.

Key Features:

  • Multi-region Bedrock access (4 EU regions: eu-west-3 Paris, eu-west-1 Ireland, eu-central-1 Frankfurt, eu-north-1 Stockholm)
  • Regional S3 buckets for multimodal operations
  • Region allow-list with global cross-region inference disabled
  • All production features (HTTPS, WAF)
  • Data residency controls for an EU-only processing footprint

Best for: Enterprise deployments, EU data residency and data sovereignty requirements


🇺🇸 Production US

US multi-region deployment for maximum availability and performance.

Enterprise deployment leveraging multiple US regions for performance and availability. Eligible failures retry in another enabled US region.

Key Features:

  • Multi-region Bedrock access (3 US regions: us-east-1, us-west-2, us-east-2)
  • Regional S3 buckets for optimal performance
  • Retry across enabled regions, each with its own Bedrock quota
  • All production features (HTTPS, WAF)
  • Maximum US availability

Best for: Enterprise deployments, US data residency, high availability requirements


Token-based access with an Amazon Cognito user pool in front of the gateway, and no shared API key anywhere.

Single-region deployment where clients obtain a short-lived access token themselves and present it on every request. Access is granted and withdrawn one application at a time, in the pool.

Key Features:

  • Amazon Cognito user pool — Self sign-up disabled, one app client per application
  • Machine-to-machine credentials — OAuth 2.0 client_credentials grant, tokens valid one hour
  • No API key — User pool tokens are the only accepted credential
  • Agent discovery — Authorization server and required scope published from the pool, nothing to keep in sync
  • Per-caller identity — The verified caller drives per-user cost attribution

Best for: Multiple client applications, autonomous agents, deployments with no shared secret to rotate


Complete AI chat platform with ChatGPT-like interface, web search, RAG, and multimodal capabilities.

Full-featured deployment of Open WebUI powered by stdapi.ai. Includes web search, document processing, vector storage, and all the features you'd expect from a modern AI chat interface.

Key Features:

  • Open WebUI — Feature-rich ChatGPT-like interface
  • Web Search — SearXNG integration for real-time information
  • Web Scraping — Playwright for content extraction
  • RAG Ready — Aurora PostgreSQL with pgvector for semantic search
  • Caching — Valkey (Redis-compatible) for performance
  • Multimodal — TTS, STT, image generation & editing, document processing

Best for: Private ChatGPT alternative, team AI assistant, complete AI chat platform


🧠 LobeHub

Private AI chat platform with vision, image generation, and knowledge-base embeddings through one OpenAI-compatible connection.

Deployment of LobeHub powered by stdapi.ai, in server DB mode with a self-hosted ParadeDB Postgres.

Key Features:

  • LobeHub — Modern chat UI with plugin/agent marketplace and knowledge base
  • Single connection — One "OpenAI" provider covers chat, vision, image generation, and embeddings
  • Self-hosted ParadeDB — Postgres 17 with pg_search + pgvector on EFS
  • Object storage — Private Amazon S3 bucket for uploads, accessed through presigned URLs
  • Caching — Valkey (Redis-compatible) for sessions

Best for: Evaluating LobeHub against Bedrock models


🔗 n8n

Preconfigured workflow automation with a credential and thirteen sample workflows already in place.

Deployment of n8n powered by stdapi.ai, with an owner account provisioned non-interactively and one runnable sample workflow per stdapi.ai route family imported automatically on first start.

Key Features:

  • n8n — Visual workflow automation in queue mode, backed by Aurora PostgreSQL with Valkey as the job queue
  • Pre-imported credential and workflows — OpenAI- and Anthropic-compatible credentials plus 13 sample workflows, seeded on first boot
  • Non-interactive owner account — No signup screen to click through
  • No local image build — The official n8nio/n8n image is pulled directly from Docker Hub

Best for: Trying stdapi.ai's full route surface through n8n's node library, no manual setup


Autonomous agent on Amazon Bedrock, with its gateway and dashboard preconfigured against stdapi.ai.

Deployment of Hermes Agent (Nous Research), with config.yaml seeded on first boot and no manual editing before the first run.

Key Features:

  • Hermes gateway + dashboard — OpenAI-compatible API and monitoring UI, dashboard behind a username/password sign-in form
  • Preconfigured config.yaml — stdapi.ai URL and API key already filled in
  • Persistent state — Config, sessions, memories, and skills on EFS
  • No local image build — The image is pulled anonymously from Docker Hub
  • ECS Exec — Shell into the container or drive Hermes' interactive CLI directly

Best for: Trying an autonomous agent loop against Bedrock models with zero API-key hunting


Autonomous agent gateway with a browser Control UI, preconfigured to drive Amazon Bedrock through stdapi.ai.

Deployment of OpenClaw, a personal-assistant and coding-agent gateway.

Key Features:

  • OpenClaw gateway + Control UI — Reachable through the ALB, token-authenticated
  • Preconfigured provider — stdapi.ai registered as a custom OpenAI-compatible provider
  • Persistence — Config, auth material, and workspace on EFS
  • No local image build — The public ghcr.io/openclaw/openclaw image is pulled anonymously
  • ℹ️ The Control UI needs HTTPS — Set alb_domain_name/alb_route53_zone_name. The API works over the default plain-HTTP listener; the browser Control UI does not work at all without a domain, because it has no WebCrypto to generate a device identity with — see The Control UI Requires HTTPS

Best for: Evaluating OpenClaw as a personal assistant or coding agent against Bedrock models


Voice assistant on AWS, bridging Home Assistant's Assist pipeline to Amazon Transcribe and Polly through stdapi.ai.

Deployment of Home Assistant with wyoming-openai as a same-task sidecar.

Key Features:

  • Home Assistant — Config on a persistent EFS volume
  • Amazon RDS for PostgreSQL — Multi-AZ db.t4g.micro holding the recorder's history and long-term statistics
  • wyoming-openai — Bridges Assist's Wyoming protocol to stdapi.ai's OpenAI-compatible audio routes
  • Amazon Transcribe + Polly — Speech-to-text and text-to-speech through stdapi.ai
  • No local image build — Both images are pulled directly from ghcr.io

Best for: Assist voice through AWS AI services — as a cloud-hosted trial, or as the AWS half of a Home Assistant you run at home


📄 Docling

Document conversion API for RAG, with its optional VLM pipeline routed through stdapi.ai to a Bedrock vision model.

Deployment of Docling Serve, CPU-only, with its Gradio demonstrator UI as the landing page and the conversion API alongside it — a POST in, structured Markdown/JSON out, for the ingestion stage of a RAG pipeline.

Key Features:

  • Docling Serve — Classical layout/OCR/table-structure extraction by default, no LLM call
  • Web UI — Docling Serve's Gradio demonstrator at /ui, which the ALB makes the landing page
  • Optional VLM pipeline — Page images routed through stdapi.ai to a vision-capable Bedrock model
  • Zero backing services — No database, cache, or file storage; models are baked into the image
  • CPU-only — No GPU required

Best for: The document-ingestion stage of a RAG pipeline


📚 RAGFlow

Complete RAG platform, with chat, embedding and reranking models bound to stdapi.ai before you ever log in.

Deployment of RAGFlow on ECS Fargate, with every backing service replaced by a managed AWS equivalent: Amazon OpenSearch Service for the document/vector store, Aurora PostgreSQL for metadata, ElastiCache Valkey for the task queue, and Amazon S3 for files.

Key Features:

  • Preconfigured providers — Chat, embedding and rerank models bound to the admin tenant during deployment, no admin UI to click through
  • Amazon OpenSearch Service — Hybrid BM25 + vector retrieval on a managed VPC domain, no self-hosted Elasticsearch
  • Amazon Bedrock reranking — Retrieved chunks reranked through stdapi.ai's Cohere-compatible endpoint
  • Task role for S3 — No static access keys for object storage

Best for: Document Q&A over your own corpus, with retrieval quality you can tune


Quick Comparison

Gateway deployments

Example Deployment Time Cost at rest Regions Data residency Best For
Production ~10 minutes ~$385/month Single region The region you deploy in Most workloads, quick start
Production GDPR ~15 minutes ~$385/month Multi-region (EU) EU regions only, global cross-region inference disabled EU enterprises, EU data residency
Production US ~15 minutes ~$385/month Multi-region (US) US regions only US enterprises, high availability
Cognito Authentication ~10 minutes ~$375/month Single region The region you deploy in Multiple client applications, no shared key

Region retry covers eligible throttling and availability failures. Streaming requests can only retry before the stream opens, and asynchronous jobs stay in the region that accepted them. Each region you enable adds its own Bedrock quota.

Application examples

Each of these deploys stdapi.ai in a single region, with the application in front of it.

Example Deployment Time Cost at rest Backing services Best For
Open WebUI ~20 minutes ~$735/month Aurora PostgreSQL, Valkey, S3 Complete chat platform, teams
LobeHub ~10 minutes ~$520/month Postgres on EFS, Valkey, S3 Evaluating LobeHub against Bedrock models
n8n ~20-25 minutes ~$545/month Aurora PostgreSQL, Valkey, EFS Workflow automation over the full route surface
Hermes Agent ~5 minutes ~$450/month EFS An autonomous agent loop on Bedrock
OpenClaw ~10-15 minutes ~$420/month EFS A personal assistant or coding agent — the Control UI needs a domain
Home Assistant ~15-20 minutes ~$445/month EFS, RDS PostgreSQL (Multi-AZ) Assist voice through Amazon Transcribe and Polly
Docling ~5 minutes ~$550/month None The ingestion stage of a RAG pipeline
RAGFlow ~40 minutes ~$1,000/month Amazon OpenSearch, Aurora PostgreSQL, Valkey, S3 Document Q&A over your own corpus

Cost at rest is what the stack bills with nothing served, in a three-AZ region at on-demand prices: the licensed gateway tasks, the application's own tasks, the NAT gateways, the load balancer and the backing services. Every ECS service defaults to one task per availability zone, so a six-zone region such as us-east-1 runs — and bills — twice as many. Amazon Bedrock and the AWS AI services are billed on top, per request. Each figure links to that sample's own breakdown.


Getting Started

Prerequisites

  1. AWS Marketplace SubscriptionStart 14-day free trial (includes hardened container images and commercial license)

    Want to evaluate first, for free? The AGPL-3.0 Community Edition image ghcr.io/stdapi-ai/stdapi.ai-community:latest exposes the same API at no cost — see Run locally with Docker. The commercial difference is hardening, support and license rights, not endpoints.

  2. Terraform or OpenTofu — Install Terraform or OpenTofu >= 1.5

  3. AWS Credentials — Configure AWS credentials with appropriate permissions

  4. Domain Name — A domain in a public Route53 hosted zone in this AWS account, to serve HTTPS from your own name. Required by Production, Production GDPR, Production US, Cognito Authentication and n8n: alb_domain_name has no default there, so apply stops without it. Optional for the other application examples, which serve plain HTTP from the generated ALB name when it is left unset. Each example's README shows how to pass it.

Cost

The stdapi.ai license is $0.10 per container-hour on the AWS Marketplace ($0.09 through a private offer), and $0 for the Community Edition image. These examples keep the module defaults, which run one task per availability zone — so a three-AZ region runs three tasks, about $216/month in license, and six in us-east-1. ALB, NAT gateways, Fargate and KMS are billed separately by AWS. Amazon Bedrock usage is billed to you directly by AWS with 0% markup.

Infrastructure included, that puts a gateway example at $375-390/month with nothing served and an application example between $420 and $1,000/month, depending on what it runs in front of the gateway. The comparison tables carry the figure per example, each linking to that example's line-by-line breakdown.

Deploy

git clone https://github.com/stdapi-ai/samples.git
cd samples/getting_started_production  # or your chosen example

No git? Download the ZIP instead:

curl -L https://github.com/stdapi-ai/samples/archive/refs/heads/main.zip -o samples.zip
unzip samples.zip && cd samples-main/getting_started_production

Follow the README in that directory for step-by-step instructions.


License

These deployment examples are licensed under the MIT License — see LICENSE for details.

The hardened stdapi.ai container image requires a separate AWS Marketplace subscription. The AGPL-3.0 Community Edition image is free.


Ready to deploy 100+ AI models on AWS?

Start 14-Day Free Trial · Full Documentation