Repository navigation
OpenAIServerModel falls through to OPENAI_BASE_URL — which makes smolagents runs recordable and replayable with no code change #2787
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.
Small finding plus the tool it enables, verified against smolagents 1.26.0 today.
Disclosure: I work on the tool (OrcaReplay, Apache-2.0).
The finding
OpenAIServerModelconstructed with noapi_basedoes not silently fall back to OpenAI's hosted endpoint — it falls through to the OpenAI SDK's ownOPENAI_BASE_URL:That is worth knowing in both directions. It means you can point smolagents at a local model, a gateway or a proxy purely through the environment — no code change. It also means if you have
OPENAI_BASE_URLexported for something else, smolagents will quietly use it.What that enables
Because the origin comes from the environment, a recording proxy can capture a run without anything being installed into smolagents — no callback, no instrumentation, no wrapper:
The program runs again against the recorded bytes with no model server anywhere on the machine. Useful for re-running an agent while you change the prompt or the tools, for CI, or for chasing one bad answer without paying for it each time.
Two honest limits
egress=blockedon replay means model-provider egress. Recorded tool calls still execute for real, so a recorded shell or search tool runs again. It is not a sandbox.If anyone knows a case where
OpenAIServerModelresolves its origin some other way, I would like to hear it — I would rather fix my assumption than ship it.All reactions