Skip to main content

InferKit - Deploy any AI function in 3 lines

Library for ML / Vision / LLM / Agent. No FastAPI boilerplate needed.

Install

pip install inferkit              # core (no Pillow)
pip install inferkit[vision]      # + Pillow for image in/out
pip install inferkit[torch,transformers]  # heavy ML stacks
pip install -e .[dev]             # local dev

Usage - 3 lines

# my_model.py
from inferkit import infer

@infer
async def run(payload, files=None):
    # payload: {"text": "..."}  files: list[bytes] for images/audio
    return {"output": f"echo: {payload.get('text')}"}

@infer.stream  # optional for LLM streaming
async def run_stream(payload):
    for tok in payload.get("text","").split():
        yield tok + " "

Run:

inferkit dev my_model.py --port 8000
# docs at http://localhost:8000/docs

Endpoints auto created:

  • POST /api/v1/infer (multipart file + json)
  • POST /api/v1/infer/json (json only)
  • POST /api/v1/infer/stream (SSE)
  • WS /ws/infer and WS /api/v1/ws/infer (WebSocket + streaming)

Image output helpers:

from inferkit import image_to_base64, bytes_to_response
from PIL import Image
return image_to_base64(Image.new("RGB",(512,512),"red"))
return bytes_to_response(png_bytes, "image/png")
# also still supported: return {"image_base64": b64} or return png_bytes

Init new project

inferkit init
# creates .env.example, .env, Dockerfile, my_model.py

Deploy (one command, any OS, auto detects Docker)

inferkit deploy
# if docker available -> docker compose/build
# else -> venv + uvicorn on INFERKIT_HOST:INFERKIT_PORT

Config via .env

INFERKIT_HOST=0.0.0.0
INFERKIT_PORT=8000
INFERKIT_CORS_ORIGINS=["*"]   # or * or http://a.com,http://b.com
INFERKIT_MAX_UPLOAD_MB=50
INFERKIT_RATE_LIMIT=60/minute
INFERKIT_API_KEY=            # if set, require X-API-Key header (also ?api_key=)
INFERKIT_DEBUG=false
# plain HOST/PORT/CORS_ORIGINS also work for backwards compat

Programmatic

from inferkit import serve
serve("my_model.py", port=8000)

Release files for inferkit 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inferkit 0.1.7
File Size Uploaded
inferkit-0.1.7.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for inferkit 0.1.7
File Interpreter ABI Platform
inferkit-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / inferkit-0.1.7.tar.gz

Download URL inferkit-0.1.7.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
128f735935dfe5b1d59c1f8028a44b1dea711affcc6b2d25a519a144453f7509
BLAKE2b-256 checksum
How to use checksums
976583bf7b87b6e9db166e10731062b42701f3303491df9eeaaeab1cb0b9fc10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / inferkit-0.1.7-py3-none-any.whl

Download URL inferkit-0.1.7-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18bd370aa332166d2d93208693314fd00a39388f20d748df16245aea8a195088
BLAKE2b-256 checksum
How to use checksums
88e840656215551fad9bc6d2faf724557a9f0f3264314a6bdebc8cdbbd2f51e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release 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