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


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.

from forge.ai import complete, Message

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

Features

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

Installation

pip install forge-kaif

With optional extras:

pip install "forge-kaif[openai]"       # OpenAI provider
pip install "forge-kaif[all]"           # all optional providers
pip install "forge-kaif[dev]"           # development tooling

Quick Start

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 ForgeKaif.

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.4.0.tar.gz (169.7 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.4.0-py3-none-any.whl (136.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: forge_kaif-0.4.0.tar.gz
  • Upload date:
  • Size: 169.7 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.4.0.tar.gz
Algorithm Hash digest
SHA256 6ef0bf317663420f4cb80ce120b857b5bf569957d0ad4cb95280fe8ba4acd048
MD5 29af554d096bb57dd6b28dd144092dee
BLAKE2b-256 e8b0cb82b3ce78856843d2d36fb4112b5ec5686d19e2efd2968551777e211496

See more details on using hashes here.

Provenance

The following attestation bundles were made for forge_kaif-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: forge_kaif-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 136.8 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c609cc80a6a807884479ec0cfe1b2614c7db6bdd49e31224a29b77dd648fccbf
MD5 c70a3acd8aea3038214892ff93dcb0bc
BLAKE2b-256 f5a4e6970de8e2bde564a78b686c0168c48884d3c8bc04cb615c48f8a4eb1acc

See more details on using hashes here.

Provenance

The following attestation bundles were made for forge_kaif-0.4.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