Repository navigation
Replaying a LlamaIndex run with the model server switched off (and a note on OpenAI vs OpenAILike) #23016
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 something I verified against llama-index-core 0.14.24 today: you can record a LlamaIndex program's model traffic from outside the process and then re-run the program with the model server switched off entirely.
Disclosure: I work on the tool (OrcaReplay, Apache-2.0).
The run
Origin comes from the environment, not from
api_base=in code — that matters, and I'll come back to it.Nothing is installed into LlamaIndex: no callback handler, no
instrumentationspan processor, no code change. It is a local proxy and an environment variable.The gotcha I hit:
OpenAIvsOpenAILikePointing the stock
OpenAILLM at a local endpoint fails before any request goes out:openai_modelname_to_contextsizevalidates the model name against OpenAI's own catalogue. For an OpenAI-compatible endpoint the documented class isOpenAILike(llama-index-llms-openai-like), with an explicitcontext_window:Obvious in hindsight, but the error message points at the model name rather than at the class, so it reads like a typo.
What this is and is not
Is: a way to re-run a LlamaIndex program deterministically for free — useful for debugging a bad answer, for CI, or for changing your prompt/pipeline and seeing whether the same model responses still produce the same result.
Is not a replacement for the observability integrations on the one-click page. Those instrument LlamaIndex internals and give you spans for retrieval, node parsing and querying. This sits outside the process and sees only the HTTP going to the model — no index-level detail at all. Different tool, different question. I mention it because the distinction is the whole reason I did not open a PR against the observability docs.
egress=blockedon replay means model-provider egress; recorded tool calls still execute for real, so it is not a sandbox.Happy to answer questions, and interested if anyone has a cleaner pattern for the custom-endpoint case.
All reactions