Notes

Going local with one line: reading base URL settings

Last updated 2026-10-09

“It also runs locally” is something one line of code says more precisely than a README. When the code that calls a cloud API reads that API's address from a setting, and the setting can point at a local server, the call stays on your machine. This note shows what that line looks like, what to put in it for a local server, and how to find it on a result page.

The OpenAI-compatible convention

Most local runners — Ollama, LM Studio, the llama.cpp server, vLLM — serve the same endpoints as the OpenAI API (/v1/chat/completions and so on). So code written against the OpenAI SDK works with a local model once the base URL it sends requests to is changed. What this site calls a “local-server setting” is the setting that decides that base URL.

How many repositories have such a setting, per provider, is in the “Local-server setting” column of Repositories by API, with today's numbers.

Two shapes seen in code

1. Read an environment variable, fall back to a local default

In TauricResearch/TradingAgents, line 361 of cli/prompts.py reads the OLLAMA_BASE_URL environment variable and uses http://localhost:11434/v1 when it is empty. The provider list right below it has cloud addresses such as OpenAI and Anthropic next to this Ollama address. Line 24 of the same repository's docker-compose.yml sets the variable to http://ollama:11434/v1.

Code like this means “you can pick a cloud provider or a local one”. On the result page the repository is “Calls external APIs · local option”, and the alternative column of the feature table names the local runner.

2. Take the address from a setting when the client is built

In Tencent/WeKnora, line 122 of dataset/qa_dataset.py builds an OpenAI client with the key from OPENAI_API_KEY and the address from OPENAI_BASE_URL. There is no default in the code, so with nothing set it goes to the SDK's default address (OpenAI). With a local server's address in that variable, the same code calls a local model.

The difference from the first shape is where the default points: left empty, the first goes local and the second goes to the cloud. Result pages tell the two apart with the “Cloud by default” and “Can switch to local” tags.

What to put in for a local server

The setting's name differs from repository to repository (OPENAI_BASE_URL, OLLAMA_BASE_URL, base_url, api_base …), but what goes in is three values.

  • Address: the OpenAI-compatible address the local runner serves. Started with its defaults, it is usually one of those below.
  • Key: a local server does not check the key, but the OpenAI SDK raises an error before sending if the key is empty. Put in any string, such as local.
  • Model name: the name of the model you have locally, not a cloud model name (gpt-…). For Ollama, it is the name ollama list shows.
Local runnerDefault address
Ollamahttp://localhost:11434/v1
LM Studiohttp://localhost:1234/v1
llama.cpp (llama-server)http://localhost:8080/v1
vLLMhttp://localhost:8000/v1

If you started it on another port or another machine, use that address. For a tool running inside Docker, localhost is the container itself, so use the service name (http://ollama:11434/v1, as in TradingAgents' docker-compose.yml above) or the host's address.

Finding it on a result page

  • A repository state of “Calls external APIs · local option” means at least one call has a local way in the code.
  • In the feature table, the default column shows where a call goes when nothing is set, and the alternative column what can replace it.
  • Expanding the call sites leads to the file and line, pinned to the commit — the links in the two examples above are such sites.

What the setting does not tell you

Being able to change the address is not the same as working equally well with a local model. If a tool relies on a particular model's features (long context, a tool-call format), results can differ locally. And within one repository some calls may be switchable while others are fixed cloud addresses. That is why this site does not sum a repository up in one sentence and lists each call on its own.

More notes · Repositories by API · Methodology