Skip to main content

llama-index-llms-oathbreaker

A LlamaIndex LLM for Oathbreaker AI, a prepaid model API that serves abliterated GLM, DeepSeek and Kimi models through an OpenAI-style Chat Completions endpoint, with streaming, tool calling and reasoning.

pip install -U llama-index-llms-oathbreaker
export OATHBREAKER_API_KEY="your-api-key"
from llama_index.llms.oathbreaker import Oathbreaker

llm = Oathbreaker(model="oathbreaker-glm-5.3", max_tokens=2048)
print(llm.complete("Reply with exactly: Oathbreaker connected."))

Create an account, add prepaid credit and create a key in your dashboard. Every request is billed per token at the rates on the pricing page.

Why not OpenAILike with a base URL

OpenAILike(api_base="https://oathbreaker.ai/v1", ...) works for a plain call once its settings are right. The API accepts a fixed list of request fields and refuses a request that carries any other, or one set to null. This class sends what the API accepts and starts from settings that fit it.

Situation OpenAILike with a base URL Oathbreaker
An agent, or a chat_with_tools call, has no tools Sends "tools": null, which is refused The empty fields are left out
reasoning_effort is set Not sent, because the model is not one of OpenAI's. "max" is not accepted Sent for every model, and "max" is accepted
The reasoning behind a tool call Left out of the history that goes back to the model Sent back with the tool call, as the API asks
strict=True Refused: strict tools are not supported Tools are sent without strict
stop or seed in additional_kwargs Refused stop is applied to the answer (see below); seed is left out with a warning
An answer reaches its output limit in the middle of a tool call LlamaIndex fills in the end of the arguments, and an agent runs the tool with what arrived IncompleteToolCallError, and the tool is not run
A request fails with a server error Sent up to 12 times by default: three tries by LlamaIndex, each of them four by the OpenAI SDK Sent once (max_retries=0). A timeout does not show that nothing was charged
A generation takes longer than a minute Times out after 60 seconds Waits 650 seconds. A generation can run for up to ten minutes
is_chat_model, is_function_calling_model, context_window Yours to set. The context window defaults to 3,900 tokens Set for you, from the model's own limits
OPENAI_API_KEY, OPENAI_ORG_ID, OPENAI_PROJECT_ID or OPENAI_CUSTOM_HEADERS is set The organization, project and custom headers are sent to Oathbreaker. A missing api_key falls back to the OpenAI key Only OATHBREAKER_API_KEY is read, and nothing from the OpenAI settings is sent

Models

Model Context window Max output
oathbreaker-glm-5.3 131,072 tokens 32,768
oathbreaker-glm-5.3-flash 131,072 tokens 32,768
oathbreaker-deepseek-v4.1-flash 65,536 tokens 32,768
oathbreaker-deepseek-v4.1-flash-fast 65,536 tokens 32,768
oathbreaker-kimi-k3.1-pro 524,288 tokens 24,576

These are the values GET https://oathbreaker.ai/v1/models reports, which needs no key. Input and requested output share the window, and the output budget includes reasoning. The class uses the model's window as context_window. For a model added after this release it plans with 65,536 tokens, the smallest window served today; pass context_window to change that.

Chat and streaming

from llama_index.core.llms import ChatMessage

messages = [
    ChatMessage(role="system", content="You answer in one sentence."),
    ChatMessage(role="user", content="What is abliteration?"),
]
print(llm.chat(messages).message.content)

for response in llm.stream_chat(messages):
    print(response.delta, end="", flush=True)

achat, astream_chat, acomplete and astream_complete work as on any LlamaIndex LLM. Token counts for a request are in response.additional_kwargs; when streaming they arrive with the last response.

Tools and agents

import asyncio

from llama_index.core.agent.workflow import FunctionAgent


def get_weather(city: str) -> str:
    """Get the current weather in a city."""
    return f"It is 21 degrees and sunny in {city}."


async def main() -> None:
    agent = FunctionAgent(tools=[get_weather], llm=llm, system_prompt="Use the tool for weather.")
    print(await agent.run("What is the weather in Lisbon?"))


asyncio.run(main())

The API returns tool calls and does not run your tools. It does not enforce tool schemas either, so check the arguments before you act on them. Hosted tools such as web search are not offered. The API runs at most 10 generations at once per account and starts at most 60 a minute.

An answer that reaches its output limit while the model is still writing a tool call raises IncompleteToolCallError, streamed or not, and the call is not passed on. The API reference says never to run an incomplete tool call. Raise max_tokens, or lower reasoning_effort, because reasoning counts towards the same limit.

Structured output

from llama_index.core.prompts import PromptTemplate
from pydantic import BaseModel, Field


class Capital(BaseModel):
    """The capital of a country."""

    country: str = Field(description="The country asked about")
    capital: str = Field(description="Its capital city")


prompt = PromptTemplate("What is the capital of {country}?")
print(llm.structured_predict(Capital, prompt, country="Portugal"))

By default the schema is bound as a tool that the model must call, and Pydantic checks the result. Oathbreaker(..., should_use_structured_outputs=True) sends the schema as response_format instead. The API passes that on to the model and does not check the answer, so a reply that does not fit the schema raises a validation error.

Reasoning

Every model reasons before it answers, and reasoning cannot be turned off. Set how much with reasoning_effort: "low", "high" or "max".

from llama_index.core.base.llms.types import ThinkingBlock

llm = Oathbreaker(model="oathbreaker-glm-5.3", max_tokens=8192, reasoning_effort="high")
response = llm.chat([ChatMessage(role="user", content="How many primes are there below 100?")])
for block in response.message.blocks:
    if isinstance(block, ThinkingBlock):
        print("Reasoning:", block.content)
print(response.message.content)

Reasoning and the answer share max_tokens. If reasoning uses the budget up, response.raw.choices[0].finish_reason is "length" and the content can be empty, so set max_tokens with room for both. The API uses 8,192 when you set none. Reasoning tokens are billed as output.

Stop sequences

The API has no stop sequences. When stop is passed, to a call or in additional_kwargs, this class cuts the answer at the first stop sequence after it arrives, for streamed answers too. The model does not stop early: it writes its whole answer, and the account pays for all of it. max_tokens limits how much that can be.

What happens to settings the API does not take

Setting What this class does
Fields that are None, user, metadata, store, service_tier Left out
seed, frequency_penalty, presence_penalty, logit_bias and any other field the API does not list Left out, with an OathbreakerWarning
strict=True Tools are sent without strict, with an OathbreakerWarning
stop Applied to the answer after it arrives, with an OathbreakerWarning about the cost
n above 1, logprobs, the old functions format, images, audio and documents in messages UnsupportedByOathbreaker, raised before anything is sent

Python shows each warning once. To silence them, or to make them errors while you test:

import warnings
from llama_index.llms.oathbreaker import OathbreakerWarning

warnings.simplefilter("ignore", OathbreakerWarning)  # or "error"

Settings

Setting Default Notes
model required One of the models above
api_key OATHBREAKER_API_KEY Creating the LLM without a key raises ValueError
api_base OATHBREAKER_BASE_URL, then https://oathbreaker.ai/v1 The host is oathbreaker.ai, with no api. subdomain
max_tokens none; the API uses 8,192 Covers reasoning and the answer. A value above the model's maximum is lowered to it
reasoning_effort none; the API chooses "low", "high" or "max"
temperature 0.1, as in LlamaIndex 0 to 2
timeout 650 Seconds
max_retries 0 Check usage before you repeat a request that timed out
context_window the model's own Used by LlamaIndex to plan prompts

Errors are the OpenAI SDK's: openai.AuthenticationError for a wrong key, openai.RateLimitError for a rate limit, openai.BadRequestError with code == "context_limit" for a request that is too long, and openai.APIStatusError with status_code == 402 when the account has no credit. The API's own message and request_id are in the error.

Not offered

  • Embeddings. Oathbreaker serves chat models only. Set Settings.embed_model to an embedding model from another provider, or to a local one.
  • Images, audio and documents. The models read and write text.

Tests

uv sync --group test
uv run pytest

The tests run against a local stand-in for the API (tests/mock_api.py) that refuses what the API reference says the API refuses. They never leave your computer, and they say nothing about model quality or speed.

uv run pytest -m live tests/test_model_list.py
OATHBREAKER_API_KEY="your-api-key" uv run pytest -m live

The first command compares the model table with the live model list; it needs no key and costs nothing. The second sends real requests and spends credit.

Checked with llama-index-core 0.14.26, llama-index-llms-openai-like 0.9.0 and openai 3.61.0 on Python 3.12.

License

MIT. Oathbreaker AI is operated by Formacha LLC. Oathbreaker operates the API and billing, not the development of the underlying models.

Metadata

Release files for llama-index-llms-oathbreaker 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-llms-oathbreaker 0.1.0
File Size Uploaded Provenance Actions
llama_index_llms_oathbreaker-0.1.0.tar.gz 32.5 kB With provenance Details for llama_index_llms_oathbreaker-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-llms-oathbreaker 0.1.0
File Interpreter ABI Platform Actions
llama_index_llms_oathbreaker-0.1.0-py3-none-any.whl Python 3 none any Details for llama_index_llms_oathbreaker-0.1.0-py3-none-any.whl

Total release size: 51.4 kB

Release files / llama_index_llms_oathbreaker-0.1.0.tar.gz

Download URL llama_index_llms_oathbreaker-0.1.0.tar.gz
Size 32.5 kB
Tags Source
SHA-256 checksum
How to use checksums
19f55a1ef31b893d9e8ea1fa02f652f604107f8b15605bfd2a18bde7d0c74b00
BLAKE2b-256 checksum
How to use checksums
743a04813333e15fd3f9eaae408a0a264878073c466c0cd6c1e33cff067fa370
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

Release files / llama_index_llms_oathbreaker-0.1.0-py3-none-any.whl

Download URL llama_index_llms_oathbreaker-0.1.0-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3de57a6a2b6b1b8b6b85ad730aa5ef6dc191a3ca99c75c887859ae1ee716d42a
BLAKE2b-256 checksum
How to use checksums
470ff775df8f765613e04ca5fe0faa219acbfbb0a4f575b7f2e432a744397e0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

Security for llama-index-llms-oathbreaker 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llama_index_llms_oathbreaker-0.1.0.tar.gz

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 Dec 3, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page