An OpenAI-compatible API lets different model servers accept the same chat request format. AnythingLLM's Generic OpenAI provider connects workspace chat to one of these servers through its API root, credentials, and model ID.
Compatibility applies to specific API features, rather than to every capability of OpenAI's service. A server that handles chat completions may still lack agent tools, image input, or embeddings, so a completed text reply establishes the chat connection.
The model server must already be running with a chat model available, and AnythingLLM's backend must be able to reach it. Changing the instance LLM preference requires access to settings and redirects subsequent prompts from workspaces that use the system default.
Steps to set an OpenAI-compatible provider in AnythingLLM:
- Open Settings from the lower-left corner of AnythingLLM.

- Expand AI Providers in the settings sidebar.

- Open LLM under AI Providers.

- Select Generic OpenAI from LLM Provider.
The Generic OpenAI option uses a custom endpoint; the separate OpenAI option is for OpenAI's hosted service.
- Enter your server's API root in Base URL.
The address normally ends in /v1, such as https://llm.example.com/v1, rather than /v1/chat/completions. AnythingLLM appends the request path. A local Ollama server on the same Docker network might use http://ollama:11434/v1, where ollama is its container name or network alias. Inside an AnythingLLM container, localhost refers to AnythingLLM itself. A server on another machine needs an address reachable from that container.
Related: How to run Ollama with Docker - Set API Key to the credential required by your endpoint.
Unauthenticated local Ollama can leave this field empty. If a client requires a nonempty value, ollama is only a placeholder and supplies no authentication. An authenticated server needs its own issued key, rather than an unrelated OpenAI key. HTTPS protects a remote key and prompt in transit; an unauthenticated local endpoint needs a trusted private network.
- Choose the endpoint's exact chat model ID in Selected Model.
AnythingLLM loads the server's model list when it is available. If the field is a text box, the model ID must match the server's advertised name exactly. The pictured model is a local Ollama alias; another server needs its own model ID. A missing list can also mean that the URL, key, or backend connectivity needs correction.
Related: How to pull an Ollama model - Set Model context window to a context budget supported by your model server.
The local model shown here uses a 2048-token budget. This field controls AnythingLLM's prompt and history budget; a larger number does not expand the model's actual context window.
- Set Max Tokens to 128 for the short connection test.
This is the reply-token limit, separate from the context budget. A short test needs only a small allowance; longer replies later need a limit supported by the model and endpoint.
- Click Save changes to apply the provider settings.
Existing workspaces with an explicit provider override keep that override.
- Reload LLM Preference to read back the saved provider settings.
Generic OpenAI, the endpoint URL, the selected model, and both token limits should retain their saved values. A populated model list alone does not prove that chat generation works.
- Return to the home screen with Back to workspaces.

- Open New Workspace with the + beside the sidebar search box.
A fresh workspace keeps the connection test separate from existing chats, documents, and provider overrides.
- Enter Cedar API in Workspace Name.
The name is an example for the empty test workspace.
- Click Save to create the test workspace.

- Open the test workspace's settings with its sidebar gear.

- Open the workspace's Chat Settings tab.

- Select Chat under Chat mode.
The new workspace inherits System default, which points to the saved Generic OpenAI provider. Chat mode autosaves and tests ordinary text generation without requiring native tool calling.
- Return to the conversation with the back arrow above the workspace settings.

- Enter the following prompt in the message box.
What is 17 plus 25? Reply in one short sentence.
- Submit the prompt with the send arrow.

- Confirm that the workspace displays a completed answer from the selected model.
The shown reply is “17 plus 25 equals 42.” Wording can vary. A complete answer without a connection or authorization error confirms that the workspace can use the configured endpoint. If generation fails, the server must be reachable from AnythingLLM, its key must be accepted, and its model ID must exist.
Related: How to view Docker logs for AnythingLLM