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
The hosted demo uses https://phoenix-yc-production.up.railway.app. Set
AUTOFIX_API_KEY in your application environment (or .env when your runtime
loads it) to authenticate heal requests. Use AUTOFIX_URL to override the
endpoint.
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
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 mnfst_autofix-0.1.0.tar.gz.
File metadata
- Download URL: mnfst_autofix-0.1.0.tar.gz
- Upload date:
- Size: 33.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6558f49e7f71d4ba489eef61af9ebaf0008d4b2ef30bf6d783615fb1f9392db7
|
|
| MD5 |
8d2ee9f34bb1b5f8b9b2f665edd5430d
|
|
| BLAKE2b-256 |
81278c36605e4ff349fbf25691c1faf3ed63e20d98bfc1558eed35fa9a7014fb
|
Provenance
The following attestation bundles were made for mnfst_autofix-0.1.0.tar.gz:
Publisher:
publish.yml on mnfst/autofix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mnfst_autofix-0.1.0.tar.gz -
Subject digest:
6558f49e7f71d4ba489eef61af9ebaf0008d4b2ef30bf6d783615fb1f9392db7 - Sigstore transparency entry: 2588929113
- Sigstore integration time:
-
Permalink:
mnfst/autofix@16670310cce7800d61271fcd88db9e48a050afa8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mnfst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16670310cce7800d61271fcd88db9e48a050afa8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mnfst_autofix-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mnfst_autofix-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef00155c2c405a0085dd8adca89ccd16c1073082852d5d5324491bb0999f8bb5
|
|
| MD5 |
51df297e8a6efc48b61424f03ace4f87
|
|
| BLAKE2b-256 |
0ea775dd333718cb33da2244a02815274089338fb23239d661c3f26135104656
|
Provenance
The following attestation bundles were made for mnfst_autofix-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on mnfst/autofix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mnfst_autofix-0.1.0-py3-none-any.whl -
Subject digest:
ef00155c2c405a0085dd8adca89ccd16c1073082852d5d5324491bb0999f8bb5 - Sigstore transparency entry: 2588929865
- Sigstore integration time:
-
Permalink:
mnfst/autofix@16670310cce7800d61271fcd88db9e48a050afa8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mnfst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16670310cce7800d61271fcd88db9e48a050afa8 -
Trigger Event:
workflow_dispatch
-
Statement type: