This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: red
aifw — Django AI Services Framework
DB-driven LLM provider, model & usage management for Django projects.
Installation
pip install aifw
Quick Start
# settings.py
INSTALLED_APPS = [
...
"aifw",
]
# Run migrations
python manage.py migrate aifw
# Use in views, tasks, management commands
from aifw.service import sync_completion, LLMResult
result: LLMResult = sync_completion(
action_code="story_writing",
messages=[{"role": "user", "content": "Write a short story about a dragon."}],
)
if result.success:
print(result.content)
Features
- DB-driven model routing — swap LLM providers/models via Django Admin, zero code changes
- Multi-provider — OpenAI, Anthropic, Google, Ollama, any LiteLLM-compatible provider
- Async & sync —
completion()(async),sync_completion()(sync),completion_with_fallback() - Usage logging — automatic token & cost tracking per action type
- Fallback models — configure primary + fallback model per action type
Models
LLMProvider— provider config (API key env var, base URL)LLMModel— model config (max tokens, cost per million tokens)AIActionType— action → model mapping with fallbackAIUsageLog— token/cost/latency tracking per request
Management Commands
python manage.py init_llm_config # seed default providers & models
Metadata
Release files for aifw 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aifw-0.5.0.tar.gz | 17.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aifw-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.6 kB
Release files / aifw-0.5.0.tar.gz
| Download URL | aifw-0.5.0.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce51230553bd6431390c9ba6d0483969de2fb1f9257a87f60ba2a42678c04e14
|
|
BLAKE2b-256 checksum How to use checksums |
acf15eb2091bdbbc8719a8e658e69f760bd84d9b9567e6c1baa75239cbccbdf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Release files / aifw-0.5.0-py3-none-any.whl
| Download URL | aifw-0.5.0-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c02b63a5e3520eb03d6bc37d7e1ccc9d83a81a53a7e2f620f2ce6ce246acb69
|
|
BLAKE2b-256 checksum How to use checksums |
205587288eff6d65c863a42cc8840b9d05e2a00e090a9b1f971a4261a35cf0bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Security for aifw 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.