Skip to main content

A modular Python infrastructure runtime for config, logging, retries, AI, and more

Project description

forge

The developer runtime for AI-era Python.

PyPI Python versions CI MIT


Stop rebuilding your infrastructure. Start shipping.

forge is a modular Python runtime that eliminates the undifferentiated heavy lifting of backend development — config, logging, retries, AI model integration, health checks, caching, and more — so you can focus on building what makes your product unique.

from forge.ai import complete, Message

response = await complete(
    messages=[Message.user("What is 2+2?")],
    model="gpt-4o",
)
print(response.content)

What is forge?

forge is not a web framework. It is the infrastructure layer that sits below your web framework — the reusable runtime that every Python backend service needs.

  • Config — typed, validated, layered configuration from env vars, .env, and TOML
  • Logging — structured JSON logging with automatic trace context propagation
  • Retry — exponential backoff, jitter, circuit breaker, and timeout management
  • AI — unified interface across OpenAI, Anthropic, Gemini, and Ollama
  • Health — Kubernetes-compatible /health and /ready endpoints
  • Cache — decorator-based caching with in-memory and Redis backends
  • Validation — Pydantic-integrated input validation with consistent error responses
  • CLIforge init, forge check config, forge add module

Quick Start

pip install forge-kaif
import asyncio
from forge.ai import complete, Message

async def main():
    response = await complete(
        messages=[Message.user("Hello, world")],
    )
    print(response.content)

asyncio.run(main())

Documentation

Full documentation is available at useforge.dev/docs.

Contributing

We welcome contributions! See CONTRIBUTING.md to get started.

License

MIT — see LICENSE for details.

Project details


Download files

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

Source Distribution

forge_kaif-0.3.0.tar.gz (145.0 kB view details)

Uploaded Source

Built Distribution

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

forge_kaif-0.3.0-py3-none-any.whl (132.6 kB view details)

Uploaded Python 3

File details

Details for the file forge_kaif-0.3.0.tar.gz.

File metadata

  • Download URL: forge_kaif-0.3.0.tar.gz
  • Upload date:
  • Size: 145.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for forge_kaif-0.3.0.tar.gz
Algorithm Hash digest
SHA256 652be415bb64c1d0e34e39b2c0d1b9c821feb4890611ff32bce41d65db90b62b
MD5 a743c1a3a1b5118c44bb8c8e17dd7595
BLAKE2b-256 dabdafdc4a169b9de61a23b3544e6e7982ae6427704dd9d03a863c26239ade4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for forge_kaif-0.3.0.tar.gz:

Publisher: publish.yml on kaif-ai-engineer/forge-kaif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file forge_kaif-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: forge_kaif-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 132.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for forge_kaif-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ff6e84277d4baeb9963fdb6830b09f5e7df33788192547c350674a2bbb3a297
MD5 f05b8dbba7581a652a075ffca5c06744
BLAKE2b-256 b235bd6ae37c9f7024f45a09990e50d94a4c66c2fb316b95b76ce0561b07d82d

See more details on using hashes here.

Provenance

The following attestation bundles were made for forge_kaif-0.3.0-py3-none-any.whl:

Publisher: publish.yml on kaif-ai-engineer/forge-kaif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page