Repository navigation
Measured: OpenAIChatCompletion honours OPENAI_BASE_URL but ignores OPENAI_API_BASE — and replaying a kernel run offline #14451
Xizhuo (xizhuomengcontin)
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Sharing a small measured result about the Python connector plus the workflow I built on top of it.
OpenAIChatCompletionhonoursOPENAI_BASE_URL, notOPENAI_API_BASEI wanted to point a kernel at a local endpoint without changing the code that builds it, so I checked which environment variable actually redirects the call rather than assuming. A local HTTP server on
127.0.0.1:9979that returns a canned chat-completion and logs the path it is asked for, semantic-kernel 1.44.1:So
OPENAI_BASE_URLredirects andOPENAI_API_BASEis ignored. Both spellings turn up across the ecosystem — I have probed frameworks that honour both, and one that honours neither because it pins the origin in its own configuration — and pointing the wrong one at a gateway gives you a run that quietly went to production. That is worth knowing independently of anything below.(
base_urlon the constructor is of course the explicit route; this is about the no-code-change path.)What I do with it: run the same kernel again for free
Once the call can be redirected, it can be recorded and replayed:
Nothing in the kernel changes — the recorder moves
OPENAI_BASE_URLfor the child process and proxies that origin.orca replay last --from N --model <other>replays the run up to step N from the recording and then continues on a different model, so when comparing models the model is the only variable rather than one of several.The case where this has paid off most for me is function calling: a plan that goes wrong on turn 7 of 20 is expensive to reproduce live, and replay makes "run that again, but change one thing" free after the first pass.
Disclosure: OrcaReplay is mine — Apache-2.0, Node 20+, no account, replay needs no key. The measurement above is about Semantic Kernel.
Three limits worth stating
If the base-URL behaviour is documented somewhere in the .NET or Python docs that I missed, I would appreciate the pointer.
All reactions