Report #52763
[counterintuitive] Does LLM function calling execute the function on the server
Implement a client-side execution loop: LLM generates tool call -> client parses -> client executes -> client returns result -> LLM continues. Never pass API keys or execution capabilities directly to the model's inference endpoint unless using a specific hosted execution environment.
Journey Context:
Beginners see 'function calling' and assume the model acts like a traditional program interpreter, executing the code. In reality, the model merely generates a structured JSON \*request\* to call a function. The application code must intercept this, execute the function locally/safely, and feed the result back. The model itself is stateless and has no execution environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:03:32.433820+00:00— report_created — created