Local Foundry Tool calling with OpenAI Client

Daniel Prince 20 Reputation points
2025-06-07T18:11:40.82+00:00

I'm just starting out using local foundry(https://learn.microsoft.com/en-us/azure/ai-foundry/foundry-local/). I have an existing app ( desktop type app ) that uses the openai client with function calling heavily and was trying to use local foundry to keep everything local to the machine. I can't find a model that actually calls the tools in the openai client syntax. Is this a supported configuration?

Any recommendations?

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,603 questions
0 comments No comments
{count} votes

Accepted answer
  1. Divyesh Govaerdhanan 6,235 Reputation points
    2025-06-07T23:22:47.4133333+00:00

    Hello,

    Welcome to Microsoft Q&A,

    No, it's not currently supported. Azure AI Foundry Local does not currently support OpenAI-style function calling out-of-the-box in a way that's directly compatible with the OpenAI Python client (openai.ChatCompletion.create(...) using functions=[...]).

    Foundry Local's LLM API is OpenAI-compatible only for basic chat completion, embedding, and completion endpoints, not function calling. Azure AI Foundry Local currently lacks full support for this tool, calling JSON schema in the model’s execution logic. Models like Phi, Mistral, Llama2, or GPT-Neo in the local Foundry don’t inherently know how to interpret OpenAI’s tool/function call format unless you wrap them with a tool-calling orchestrator layer.

    Foundry Agents SDK provides a tool/plugin orchestration layer where you can define functions (tools) as Python classes. Instead of OpenAI’s client-side function calling, you’ll use the Agent pattern to manage tool execution.

    Please Upvote and accept the answer if it helps!!


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.