LiteLLM
LiteLLM SDK and Proxy with an OpenAI-compatible uncensored API
Call Abliterator from LiteLLM with the openai/ model prefix and api_base, stream responses, and register both Abliterator models in a LiteLLM Proxy config.yaml.
Prefix the model with openai/ and pass api_base: litellm.completion(model="openai/kimi-k3.1-pro-abliterated", api_base="https://abliterator.ai/v1", api_key=os.environ["ABL_API_KEY"]). The same three values go in litellm_params for the proxy.
LiteLLM routes one call signature to many providers. For an OpenAI-compatible server like Abliterator you give it the openai/ prefix, an api_base and a key. Tested with litellm 1.111, both the Python SDK and the proxy.
Install
pip install litellm
export ABL_API_KEY="sk-abl-v1-..."
Install litellm[proxy] instead if you will run the proxy server.
Call Abliterator from the SDK
import os
import litellm
response = litellm.completion(
model="openai/kimi-k3.1-pro-abliterated",
api_base="https://abliterator.ai/v1",
api_key=os.environ["ABL_API_KEY"],
messages=[
{"role": "system", "content": "You are a red-team lead preparing an engagement report."},
{"role": "user", "content": "Write the executive summary for a phishing simulation where 14% of staff entered credentials."},
],
max_tokens=800,
)
print(response.choices[0].message.content)
print("cost (USD):", response._hidden_params["response_cost"])
api_base must include /v1. LiteLLM uses the OpenAI client underneath, which appends /chat/completions on its own.
Streaming
import os
import litellm
stream = litellm.completion(
model="openai/deepseek-v4.1-flash-abliterated",
api_base="https://abliterator.ai/v1",
api_key=os.environ["ABL_API_KEY"],
messages=[{"role": "user", "content": "Give me ten realistic test cases for a prompt-injection filter."}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
delta = chunk.choices[0].delta.content if chunk.choices else None
if delta:
print(delta, end="", flush=True)
print()
litellm.acompletion is the async version and takes the same arguments. Model evals are a good fit for deepseek-v4.1-flash-abliterated, which costs $1.00 per million input tokens.
Run Abliterator behind the LiteLLM Proxy
The proxy gives every app in your company one OpenAI-compatible endpoint with its own virtual keys and budgets, while the Abliterator key stays on the server. Register both models in config.yaml:
model_list:
- model_name: abl-kimi
litellm_params:
model: openai/kimi-k3.1-pro-abliterated
api_base: https://abliterator.ai/v1
api_key: os.environ/ABL_API_KEY
- model_name: abl-flash
litellm_params:
model: openai/deepseek-v4.1-flash-abliterated
api_base: https://abliterator.ai/v1
api_key: os.environ/ABL_API_KEY
litellm_settings:
num_retries: 2
general_settings:
master_key: os.environ/LITELLM_MASTER_KEY
os.environ/ABL_API_KEY tells LiteLLM to read the key from the environment at startup, so it never sits in the file. Current LiteLLM versions refuse to start without a master key, so generate one and start the proxy:
export LITELLM_MASTER_KEY="sk-$(openssl rand -hex 32)"
litellm --config config.yaml --port 4000
Clients then use the proxy's URL, the master key (or a virtual key created with it) and the model_name aliases:
import os
from openai import OpenAI
client = OpenAI(base_url="http://localhost:4000", api_key=os.environ["LITELLM_MASTER_KEY"])
resp = client.chat.completions.create(
model="abl-flash",
messages=[{"role": "user", "content": "Classify this log line: 'Failed password for root from 198.51.100.7 port 52144 ssh2'"}],
)
print(resp.choices[0].message.content)
Troubleshooting
BadRequestError: LLM Provider NOT provided. The model string has no provider prefix. Useopenai/kimi-k3.1-pro-abliterated, not the bare ID.NotFoundErrorfrom Abliterator.api_baseis missing/v1, or it ends in/chat/completions. It should be exactlyhttps://abliterator.ai/v1.LiteLLM proxy refused to start: no master key is set. ExportLITELLM_MASTER_KEYas above. Do not reuse your Abliterator key as the master key.- The proxy returns 401 to your apps. Apps must send the proxy's master key or a virtual key it issued, not the Abliterator key. The Abliterator key only lives in the proxy's environment.
UnsupportedParamsErrorfor an OpenAI-only parameter. LiteLLM validates parameters against theopenai/provider. Setlitellm.drop_params = True(ordrop_params: trueunderlitellm_settings) to drop the ones Abliterator would not use.- Concurrent agents trip 429s. LiteLLM retries on its own, and so does the OpenAI client inside it. Keep
num_retrieslow and cap parallelism to your plan's limit; see /docs/rate-limits.
Frequently asked questions
Why does LiteLLM need the openai/ prefix?
The prefix picks LiteLLM's provider adapter. openai/ means 'send an OpenAI Chat Completions request to api_base'. LiteLLM strips it, so Abliterator receives the bare model ID.
Does LiteLLM's spend tracking show the right cost for Abliterator?
Yes, when Abliterator reports it. LiteLLM reads the usage.cost field Abliterator returns and uses it as response_cost, so proxy spend logs match Abliterator's bill even though the model is not in LiteLLM's price map.
Can the LiteLLM Proxy expose Abliterator to apps that speak the Anthropic format?
There is no need. Abliterator already serves the Anthropic Messages API directly at its own base URL, so point Anthropic SDK clients at Abliterator instead of routing them through the proxy.