Repository navigation
Measured: OpenAIChatGenerator honours OPENAI_BASE_URL but ignores OPENAI_API_BASE — and how I replay a pipeline offline #12773
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.
Two things here: a small measured fact about Haystack that is useful on its own, and what I do with it.
OpenAIChatGeneratorhonoursOPENAI_BASE_URL, notOPENAI_API_BASEI wanted to point a pipeline at a local endpoint without editing the pipeline, so I checked which variable actually redirects it. Local HTTP server on
127.0.0.1:9978returning a canned chat-completion and logging the path it is asked for, haystack-ai 3.1.1:So
OPENAI_BASE_URLworks andOPENAI_API_BASEis silently ignored. Both spellings are common across the ecosystem — I have probed frameworks that accept both, and one that accepts neither because it pins the origin in its own config — and pointing the wrong one at a proxy or gateway gives you a run that quietly went to production. Worth knowing whatever you are pointing Haystack at.What I use it for: running the same pipeline again for free
Once the calls can be redirected, they can be recorded and replayed. I run the pipeline once for real under a recorder, and after that the same run happens offline:
Nothing in the pipeline changes — the recorder just moves
OPENAI_BASE_URLfor the child process.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 you are comparing models the model is the only variable.Disclosure: OrcaReplay is mine — Apache-2.0, Node 20+, no account, replay needs no key. The measurement above is about Haystack and holds regardless of what you use it with.
Three limits
LinkContentFetcherstill fetches, a custom component still calls whatever it calls.If the base-URL behaviour above is already documented somewhere I missed, I would genuinely like the pointer.
All reactions