Skip to main content

APIPod

Build, Deploy, and publish AI Services with Ease

APIPod Logo

APIPod combines the developer experience of FastAPI with the power of Serverless GPU computing.
Write your service like FastAPI. Run it anywhere with a single command.
Think Vercel — but for AI services.

Why APIPodInstallationQuick StartDevelop & TestBuild & Deploy


Why APIPod?

Building AI services is complex: file handling, long-running inference, job queues, deployment, scaling, and hosting provider choices all create friction at every step.

APIPod eliminates that friction. It abstracts away the AI infrastructure stack so you can focus on your model. You write the service; Socaity handles the deployment and scaling across any cloud.

Highlights

  1. Write once, run anywhere — the same code runs in development, in serverless emulation, or on a real GPU cloud. Zero changes between environments.
  2. Drop-in FastAPI — if you know FastAPI, you already know APIPod. Built on top of it, with batteries included for AI.
  3. Standardized I/O — painless Images, Audio and Video via media-toolkit.
  4. OpenAI-compatible schemas — built-in request/response schemas for chat, completions, embeddings, TTS, transcription, image/video generation. OpenAI clients work out of the box.
  5. Built-in job queue — async jobs, polling and progress tracking, with no Celery/Redis/Kubernetes to wire up.
  6. One-command packagingapipod build generates your Dockerfile. No CUDA hell; APIPod picks compatible images.

Installation

pip install apipod

Quick Start

APIPod is a drop-in replacement for FastAPI. You get all of APIPod's capabilities with no migration cost.

from apipod import APIPod, ImageFile

# Drop-in replacement for FastAPI
app = APIPod()

# A standard endpoint
@app.endpoint("/hello")
def hello(name: str):
    return f"Hello {name}!"

# Built-in media processing — uploads/URLs/base64 are parsed for you
@app.endpoint("/process-image")
def process_image(image: ImageFile):
    img_array = image.to_np_array()
    # ... run your AI model here ...
    return ImageFile().from_np_array(img_array)

if __name__ == "__main__":
    app.start()

Run it and open http://localhost:8000/docs for the auto-generated Swagger UI.

python main.py
# or
apipod start

Smart File Handling

Forget about parsing multipart/form-data, base64, or bytes. APIPod integrates with MediaToolkit to handle files as objects. Whether the client sends a file upload, a URL, or a base64 string, your endpoint receives a ready-to-use object.

from apipod import AudioFile

@app.post("/transcribe")
def transcribe(audio: AudioFile):
    # Auto-converts URLs, bytes, or uploads to a usable object
    audio_data = audio.to_bytes()
    return {"transcription": "..."}

Model Loading Presets

Declare your weights; APIPod loads them at app start and the platform pre-stages them per provider (RunPod HF cache, image baking). Two built-in presets cover the transformers library:

import apipod

llm = apipod.TransformersLLM("Qwen/Qwen2.5-7B-Instruct")      # chat LLM: generate / stream / embed_text
vlm = apipod.TransformersVLM("Qwen/Qwen3-VL-8B-Instruct")     # vision-language: image chat / stream / embed

Both pick the fastest attention backend on the machine (flash-attn 2 when installed on an Ampere+ GPU, PyTorch SDPA otherwise). Subclass apipod.Model for custom load logic.

Serve a Model in One Call

apipod.serve(model) registers the standard OpenAI-compatible endpoints matching the model's methods, then starts the app. Model and service stay separate: the same instance works standalone (model.generate(...)) or served.

import apipod

model = apipod.TransformersVLM("Qwen/Qwen3-VL-8B-Instruct")

if __name__ == "__main__":
    apipod.serve(model, title="Qwen3-VL", description="...")   # /chat (image+text) + /embeddings

Endpoint mapping: generate/stream -> /chat, embed or embed_text -> /embeddings, generate_image -> /images. Custom apipod.Model subclasses participate by implementing methods with those names. For custom routes, build an APIPod app yourself (or pass it via serve(model, app=app)).

AI Services Streamlined (OpenAI-compatible)

APIPod provides built-in request/response schemas for common AI tasks (chat, TTS, image gen, etc.) that are fully OpenAI-compatible. This allows you to focus on the model logic while APIPod handles the boilerplate of validation, media parsing, and streaming.

from apipod.common.schemas import ChatCompletionRequest

@app.endpoint("/chat")
def chat(request: ChatCompletionRequest):
    if request.stream:
        # Yield plain tokens — APIPod wraps them into ChatCompletionChunk SSE events.
        return my_llm.stream(request.messages)
    return my_llm.generate(request.messages) # auto-wrapped into ChatCompletionResponse

Asynchronous Jobs & Scaling

For long-running tasks, APIPod provides a built-in job queue and progress reporting. When configured for serverless or with a queue, endpoints automatically return a job_id and run in the background.

from apipod import JobProgress

@app.post("/generate", queue_size=50)
def generate(job_progress: JobProgress, prompt: str):
    job_progress.set_status(0.1, "Initializing model...")
    # ... heavy computation ...
    job_progress.set_status(1.0, "Done!")
    return "Generation Complete"
  • Client: Receives a job_id immediately.
  • Server: Processes the task in the background.
  • SDK: Automatically polls for status and result.

Develop, Test, and Simulate

Just say how you want to run the service right now.

Development (default)

Plain FastAPI. The fastest iteration loop.

apipod start
# or simply
python main.py

Simulate a deployment

Before you ship, run your service exactly how it will behave in production — locally, with no code changes. apipod simulate takes an optional target string {compute}-{provider} (compute defaults to serverless).

apipod simulate                    # serverless emulation: FastAPI + local job queue
apipod simulate serverless         # same as above
apipod simulate dedicated          # plain FastAPI (dedicated compute)
apipod simulate serverless-runpod  # emulate Socaity routing requests to RunPod
apipod simulate dedicated-azure    # emulate a dedicated Azure deployment

If a provider has no serverless offering, APIPod warns and falls back to the job-queue emulation:

apipod simulate serverless-azure
# Warning: azure does not support serverless. Defaulting to FastAPI + Local Job Queue.

Emulate a provider's native worker (--native)

By default Socaity is the orchestrator. --native skips Socaity and runs the provider's own serverless backend locally — e.g. RunPod's serverless worker (requires the runpod package):

apipod simulate serverless-runpod --native

Configure from Python

The same intent can be set in code. Socaity overrides it with env vars once the service is actually managed by the platform, so what you test is what you ship.

app = APIPod()                                            # development (plain FastAPI)
app = APIPod(simulate="serverless")                       # FastAPI + local job queue
app = APIPod(simulate="serverless-runpod", direct=True)   # RunPod native worker (local)

Build & Deploy

Build a container

apipod build

This scans your project, picks a compatible base image (CUDA/cuDNN, ffmpeg included) and generates a Dockerfile. For most users this is all you need; advanced users can edit or write their own Dockerfile.

Requirements: Docker installed, plus a CUDA/cuDNN setup if your model needs the GPU.

Analyze and deploy

apipod analyze                # pre-deploy report: HF repo checks, catalog match, GPU recommendation
apipod deploy                 # full deploy: analyze, build, push, provision

Both commands need a Socaity login (socaity login); everything else in APIPod works offline. analyze only prints a report. deploy runs the analysis, resolves your declared models against the Socaity catalog, creates the deployment, builds your container, pushes it to the Socaity registry with one-time credentials, and waits until the service is live. No dashboard step and no registry account needed.

Useful variants:

apipod deploy --skip-build                # push the already-built local image
apipod deploy --resume DEPLOYMENT_ID      # retry the push for an existing deployment
apipod deploy --resume DEPLOYMENT_ID --push-only   # only push + wait, never build

Client SDK

Generate a typed client for your service using the fastSDK. It handles authentication, file uploads, and automatic polling for background jobs.

fastsdk generate http://localhost:8009 -o myClient.py
from myClient import myService

client = myService() 
client.text_to_speech("what a time to be alive")

Comparison

Feature APIPod FastAPI Celery Replicate/Cog
Setup Difficulty Easy Easy Hard Medium
Async/Job Queue ✅ Built-in ❌ Manual ✅ Native ✅ Native
Serverless Ready ✅ Native ❌ Manual ❌ No ✅ Native
File Handling ✅ Standardized ⚠️ Manual ❌ Manual ❌ Manual
Router Support
Multi-cloud

Roadmap

  • MCP protocol support.

Made with ❤️ by SocAIty

Download files

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

Source Distribution

apipod-1.0.17.tar.gz (139.4 kB view details)

Uploaded Source

Built Distribution

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

apipod-1.0.17-py3-none-any.whl (139.7 kB view details)

Uploaded Python 3

File details

Details for the file apipod-1.0.17.tar.gz.

File metadata

  • Download URL: apipod-1.0.17.tar.gz
  • Upload date:
  • Size: 139.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for apipod-1.0.17.tar.gz
Algorithm Hash digest
SHA256 a25fec3475f8d5c59f96a3b19c0d86f80143a33fdefc3aea0708f06ee01663dd
MD5 bf675fa2b990c5c631ca8dbe088e2109
BLAKE2b-256 700876ff6e99950d58d8cf7b6a32f3848f199c66892e03f9c01c564c0d1a6c4e

See more details on using hashes here.

File details

Details for the file apipod-1.0.17-py3-none-any.whl.

File metadata

  • Download URL: apipod-1.0.17-py3-none-any.whl
  • Upload date:
  • Size: 139.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for apipod-1.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 ab119279e47311ce544930b76bcbfe4f34d071ddab8c3b7d402df73e370d5768
MD5 daacf45fe043d0455a8ea7844ac0e46f
BLAKE2b-256 95048fc77ae757bab733e59ad94f8bce44874dce36428d48443aff4be1cc32ed

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.25

2 files

1.0.24

2 files

1.0.20

2 files

1.0.19

2 files

1.0.18

2 files

This release

1.0.17 This release

2 files

1.0.16

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page