You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Answer the OpenAI-shaped calls from wherever the deployment says (#13)
* Answer the OpenAI-shaped calls from wherever the deployment says
OpenBot already runs on your own machine, in your own PostgreSQL, with a
model key you supply. The one thing it could not do was decide where that
key is spent: `agent-bot` constructed its client with a key and no base
URL, `agent-langgraph` did the same through `ChatOpenAI`, and compose
handed neither of them a way to be told otherwise. A deployment that had
put a gateway or a proxy in front of its models, or that runs the model
on hardware it controls, had to fork two files to use it.
`OPENAI_BASE_URL` is that decision, and the API server already honoured
it: `resolveModel` in the pinned runtime reads it for every `openai/*`
model, so the package built-in agents have always been movable. This
gives the two shipped Bots the same variable and hands it to both
containers, so one line moves the whole deployment rather than the half
of it that happens to run outside Docker.
It is a base URL rather than another `BOT_PROVIDER` branch because the
API is the contract. `anthropic` and `google` are different APIs, not
different URLs for this one, and they are untouched. Model names travel
verbatim in `BOT_MODEL` and in the tenant package's `default_model`,
because an endpoint names its own catalogue.
Verified against a live OpenAI-compatible gateway: both Bots stream
AG-UI and emit tool calls, which is what a Bot needs to drive its
computer.
* Point the other two providers somewhere else as well
The OpenAI half of this landed the right idea and stopped one provider short.
A deployment that fronts Anthropic or Google the same way, or runs either on
its own hardware, had the same silent split this change set out to remove:
the API server would follow and agent-langgraph would not.
Both use the names the API server already reads, so one line still moves the
built-in agents and the Bot together.
agent-bot is untouched. It speaks the OpenAI API directly by construction, so
there is no Anthropic or Google call in it to redirect.
---------
Co-authored-by: David McKay <davidmckayv@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/configuration.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,12 +37,50 @@ All four Intelligence values are required together. Missing any of them stops se
37
37
|`TENANT_PACKAGE_DIR`|`../examples/fintech`| Tenant package directory, resolved from `server/`. |
38
38
|`DEPLOYMENT_ID`| the tenant package's id | Names this deployment inside a shared Intelligence project. |
39
39
|`OPENAI_API_KEY`| unset | Default model key for built-in agents and both shipped Bots. |
40
+
|`OPENAI_BASE_URL`| unset | OpenAI-compatible endpoint that key is spent against. See below. |
40
41
|`BOT_PROVIDER`|`openai`| Provider for `agent-langgraph`: `openai`, `anthropic`, or `google`. |
41
42
|`ANTHROPIC_API_KEY`| unset | Anthropic key when `BOT_PROVIDER=anthropic`. |
43
+
|`ANTHROPIC_BASE_URL`| unset | Anthropic-compatible endpoint that key is spent against. |
42
44
|`GOOGLE_API_KEY`| unset | Google key when `BOT_PROVIDER=google`. |
45
+
|`GOOGLE_GENERATIVE_AI_BASE_URL`| unset | Google-compatible endpoint that key is spent against. |
43
46
|`BOT_MODEL`| provider default from Bot code/env | Model used by the shipped Bots. |
44
47
|`BOT_RESPONSES_API`|`false`| Makes `agent-langgraph` use the OpenAI Responses API. |
45
48
49
+
## OpenAI-compatible endpoints
50
+
51
+
`OPENAI_BASE_URL` decides where an OpenAI-shaped request is answered. Unset, that is OpenAI. Set, it is any endpoint speaking the same API: a gateway in front of several providers, a proxy, or a model on hardware you control.
52
+
53
+
It moves the whole deployment rather than one Bot. The API server reads it for package built-in agents, `agent-bot` reads it for the client it constructs, and `agent-langgraph` reads it for `BOT_PROVIDER=openai`.
54
+
55
+
The other two providers work the same way under their own names, because they are different APIs rather than different URLs for this one: `ANTHROPIC_BASE_URL` and `GOOGLE_GENERATIVE_AI_BASE_URL`. All three are the names the API server already reads, so one line moves the built-in agents and the Bots together and a deployment cannot end up with half of itself pointed somewhere else.
56
+
57
+
Model names travel verbatim, so use whatever the endpoint publishes. An endpoint that namespaces its catalogue wants both halves of the name, in `BOT_MODEL` and in the tenant package's `default_model` alike.
58
+
59
+
[LLMTR](https://llmtr.com) is one such gateway. It fronts OpenAI, Anthropic, Google and others behind one key, and hosts models in Turkey for deployments that need the data to stay there, which is the same reason a deployment runs OpenBot on its own infrastructure. Addressed the usual way:
60
+
61
+
```sh
62
+
OPENAI_BASE_URL=https://llmtr.com/v1
63
+
OPENAI_API_KEY=llmtr-...
64
+
BOT_MODEL=openai/gpt-4o # or llmtr/gemma-4, or anthropic/claude-sonnet-4.5
65
+
```
66
+
67
+
and in the tenant package, where the name is namespaced the same way:
68
+
69
+
```yaml
70
+
model:
71
+
provider: openai
72
+
credential_secret_ref: openai-api-key
73
+
default_model: openai/gpt-4o
74
+
```
75
+
76
+
Its catalogue is public and needs no key, so the names above can be checked before anything is configured:
77
+
78
+
```sh
79
+
curl -s https://llmtr.com/v1/models
80
+
```
81
+
82
+
Two things are worth knowing before pointing a deployment at any gateway. Not every catalogue entry accepts tools, and a Bot without tool calling cannot drive its computer; the model list says which do. And `BOT_RESPONSES_API=true` needs an endpoint that implements the Responses API, not only chat completions.
83
+
46
84
## Authentication
47
85
48
86
| Variable | Meaning |
@@ -223,7 +261,7 @@ model:
223
261
default_model: gpt-4.1
224
262
```
225
263
226
-
`provider`must be `openai`. `credential_secret_ref` is a reference to a stored credential, not a credential value.
264
+
`provider`must be `openai`. `credential_secret_ref` is a reference to a stored credential, not a credential value. `default_model` is passed through as written, so an OpenAI-compatible endpoint reached through `OPENAI_BASE_URL` takes the name that endpoint publishes.
0 commit comments