A modular Python infrastructure runtime for config, logging, retries, AI, and more
Project description
forge
The developer runtime for AI-era Python.
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
/healthand/readyendpoints - Cache — decorator-based caching with in-memory and Redis backends
- Validation — Pydantic-integrated input validation with consistent error responses
- CLI —
forge 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef0bf317663420f4cb80ce120b857b5bf569957d0ad4cb95280fe8ba4acd048
|
|
| MD5 |
29af554d096bb57dd6b28dd144092dee
|
|
| BLAKE2b-256 |
e8b0cb82b3ce78856843d2d36fb4112b5ec5686d19e2efd2968551777e211496
|
Provenance
The following attestation bundles were made for forge_kaif-0.4.0.tar.gz:
Publisher:
publish.yml on kaif-ai-engineer/forge-kaif
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forge_kaif-0.4.0.tar.gz -
Subject digest:
6ef0bf317663420f4cb80ce120b857b5bf569957d0ad4cb95280fe8ba4acd048 - Sigstore transparency entry: 2118969315
- Sigstore integration time:
-
Permalink:
kaif-ai-engineer/forge-kaif@3a187f5ecdca832f334afbecf6e9aefe8eaeb644 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/kaif-ai-engineer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3a187f5ecdca832f334afbecf6e9aefe8eaeb644 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c609cc80a6a807884479ec0cfe1b2614c7db6bdd49e31224a29b77dd648fccbf
|
|
| MD5 |
c70a3acd8aea3038214892ff93dcb0bc
|
|
| BLAKE2b-256 |
f5a4e6970de8e2bde564a78b686c0168c48884d3c8bc04cb615c48f8a4eb1acc
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forge_kaif-0.4.0-py3-none-any.whl -
Subject digest:
c609cc80a6a807884479ec0cfe1b2614c7db6bdd49e31224a29b77dd648fccbf - Sigstore transparency entry: 2118969346
- Sigstore integration time:
-
Permalink:
kaif-ai-engineer/forge-kaif@3a187f5ecdca832f334afbecf6e9aefe8eaeb644 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/kaif-ai-engineer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3a187f5ecdca832f334afbecf6e9aefe8eaeb644 -
Trigger Event:
push
-
Statement type: