Use LlamaIndex with an uncensored LLM API
LlamaIndex ships a separate class for third-party OpenAI-style servers, OpenAILike. The plain OpenAI class checks model names against OpenAI's list, which is why you need this one.
Set it up
- Sign in at wildwestapi.com/signup/ with the six-digit code sent to your email, open the dashboard and create an API key. It starts with sk-ww- and is shown in full once, so copy it somewhere safe.
- Install with pip install llama-index-llms-openai-like.
- Export WILDWEST_API_KEY.
- Create OpenAILike with model outlaw-1, api_base https://wildwestapi.com/v1 and your key as api_key.
- Set is_chat_model=True, is_function_calling_model=True and a real context_window.
- Assign it to Settings.llm so indexes and query engines use it.
A working setup
import os
from llama_index.core import Settings
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(
model="outlaw-1",
api_base="https://wildwestapi.com/v1",
api_key=os.environ["WILDWEST_API_KEY"],
is_chat_model=True,
is_function_calling_model=True,
context_window=500000,
)
Settings.llm = llm
print(llm.complete("Write one noir sentence.").text)
The three flags that matter
The class reference lists is_chat_model and is_function_calling_model as defaulting to False, and a context_window default of 3900. Left alone, that tells LlamaIndex to use the completion endpoint, skip tools and chop your context to a few thousand tokens. Set the first two to True for chat models that take tools. Most Wild West models have 1M tokens of context and the qwen model has 512K, so 500000 is safe for all of them. Raise it for the 1M models if you need it.
Embeddings are a separate decision
This class replaces only the language model. An index still needs an embedding model, and LlamaIndex defaults to OpenAI's. This page does not cover embeddings, so configure Settings.embed_model to something local or from another provider.
One limit to know
If you leave the default embedding model in place, LlamaIndex will try to call OpenAI with your Wild West key and fail with a 401 that looks unrelated to the chat model. Set the embedding model explicitly before you build an index.
FAQ
Why not use the OpenAI class with api_base?
OpenAILike exists for third-party servers. The OpenAI class looks up model names and context sizes from its own table, which does not know outlaw-1.
Can I use it for agents with tools?
Yes, with is_function_calling_model=True and a model that supports tools. Most Wild West models do.