Autofix Python
Self-healing HTTP transport for LLM SDKs — the OpenAI and Anthropic Python SDKs. When a request fails with a fixable request-shape error — a renamed parameter, a restricted value, a retired model — autofix repairs it at runtime and retries. Your code doesn't change; your users never see the failure.
Installation
Use one import per SDK. Routing follows the request path, including custom
base_url values.
pip install mnfst-autofix
Usage
from openai import OpenAI
from mnfst_autofix.openai import autofix
client = OpenAI(http_client=autofix())
res = client.chat.completions.create(
model="gpt-5-mini",
temperature=0.2, # gpt-5 models reject this - normally a 400
messages=[{"role": "user", "content": "Hello!"}],
)
# -> healed at runtime (temperature set to 1), returns a normal 200
That's the whole integration — every call on this client is self-healing.
Async works the same way:
from openai import AsyncOpenAI
from mnfst_autofix.openai import autofix_async
client = AsyncOpenAI(http_client=autofix_async())
For Anthropic:
from anthropic import Anthropic
from mnfst_autofix.anthropic import autofix
client = Anthropic(http_client=autofix())
For LiteLLM:
from openai import OpenAI
from mnfst_autofix.openai import autofix
client = OpenAI(
base_url="http://localhost:4000/v1",
http_client=autofix(),
)
How it works
On a 400, 404 or 422, autofix applies the privacy filter described below, asks the heal API for the current fix, applies it, and replays once. Anything goes wrong → your original error, unchanged.
Never worse than without it
- Zero overhead on success — the transport only wakes up on a healable failure.
- Fail open — heal API down, slow, or out of ideas: you get the original error. The heal call has a 5s budget, so it can't sit on top of a failure you're already waiting for.
- Your key never leaves — the provider API key stays on your SDK's request, on its original path.
Privacy
The heal API receives settings, not prompt data:
// sent to the heal API
{
"model": "gpt-5-mini",
"temperature": 0.2
}
// kept local and restored on replay
{
"messages": [{ "role": "user", "content": "Hello!" }],
"tools": [...]
}
Scalar settings and scalar-only arrays may travel. Prompts, tools, nested arrays, schema bodies, identity fields, and credential fields stay local. The provider error, endpoint origin and path, derived workspace id, and SDK source are also sent.
autofix(send_messages=True) (default False) opts the top-level messages
list in, verbatim — for teams pointing at their own heal service who want the
conversation visible next to the failure it caused. It is observability only:
the heal API still cannot author or rewrite a message on the way back.
See heals
client = OpenAI(
http_client=autofix(
on_heal=lambda event: print(event.heal_status, event.summary),
),
)
License
MIT © Manifest
Metadata
Release files for mnfst-autofix 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mnfst_autofix-0.1.1.tar.gz | 33.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mnfst_autofix-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.4 kB
Release files / mnfst_autofix-0.1.1.tar.gz
| Download URL | mnfst_autofix-0.1.1.tar.gz |
|---|---|
| Size | 33.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4a71ea78d04931db1fbdb6d2a4a8a246abf742a96da2422c3a46da771ae9c7a
|
|
BLAKE2b-256 checksum How to use checksums |
5750a5503d7f4753ce328f00ee77fa963ee6bf1e69906a526a88f6cd2e75971b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency logRelease files / mnfst_autofix-0.1.1-py3-none-any.whl
| Download URL | mnfst_autofix-0.1.1-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
438a4a532befff0444c640b814bc0878b34e22486c286a83f9aa895a80b17732
|
|
BLAKE2b-256 checksum How to use checksums |
daaeae88310a4b579d0b68100c97d79a4194c9b6c2136aa8d24329e44a28da8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency log