Choosing an AI application stack starts with a simple goal: use the lowest abstraction that lets you build the app, swap models and still reach each model’s best features. Microsoft’s Foundry team lays out the options as a ladder, from raw HTTP calls to agent frameworks, and says you may not need a framework at all. Fighting one that doesn’t fit your case costs more than writing a few extra lines.
Start with the model, but don’t commit
Knowing the best model for a job is hard before you’ve written code. Model cards publish benchmark results, such as the MAI-Code-1-Flash card’s 71.6% pass rate on SWE-Bench Verified. Benchmarks miss messy real tasks, and older ones may appear in training data. Leaderboards help too: ArtificialAnalysis tracks intelligence, speed and cost per task, Arena.ai has Text Arena and Agent Arena, and Foundry has its own.
Treat any pick as a starting point. Prompt engineering, context engineering, evaluation and optimization decide how well the model does. For providers, large models need a cloud host, while small ones can run locally or on rented GPUs. Microsoft recommends a provider with flexibility and consumption-based pricing, and points to Foundry’s catalog of 11,000+ models from OpenAI, Anthropic, DeepSeek, Mistral, Fireworks AI and Hugging Face.

Three HTTP APIs
Once you have an endpoint and a credential, you can call the API directly, use an official vendor library or use a third-party framework. Foundry users will mostly meet three APIs.
OpenAI’s Chat Completions API arrived in 2021 and became a de facto industry standard. Ollama and Foundry Local support it. It isn’t where new capabilities are built anymore, and OpenAI recommends the Responses API for new projects. Existing Chat Completions code should migrate to avoid missing later features, and Microsoft offers an agent skill for that.
The Responses API launched with GPT-5 in August 2025, and a vendor-neutral version is documented in the Open Responses specification. It handles multimodal and tool-calling better, adds server-side tools such as code interpreter, offers optional stored conversation state keyed by response ID, and has automatic and explicit prompt caching. It’s the right choice for GPT-5 family models, and it also suits DeepSeek-V4-Flash or Kimi K2.7. Foundry supports it for Foundry Direct models other than Anthropic’s.
Anthropic’s Messages API is tuned for Claude. It is stateless, so you replay messages each time. It has cache controls, adaptive thinking and finer token budgets. The Foundry team’s favorite feature is built-in citations: you supply source text in a structured list and the model returns the sources it used.

Swapping models with libraries and routers
If you value swapping above squeezing out every feature, use a model-agnostic layer. The Responses API works for non-Anthropic models on Foundry, Foundry Local, Ollama and vLLM. For Anthropic or other hosts, LiteLLM offers an OpenAI-style interface across 100+ models and providers, and lm15 and any-llm are similar. The cost is that model-specific features become harder to reach.
A model router chooses a model by task type or complexity, with allowed models, retries and fallbacks. Examples are OpenRouter, LiteLLM’s routing and Foundry’s model router. A Foundry router can switch between GPT-5.6 Sol and Llama 4 Maverick in a balanced mode that optimizes cost while keeping quality. Routers fit projects where cost matters most and several models work, but you lose model-specific tuning.

When you need an agent framework
Single calls are the most deterministic and easiest to evaluate. Some tasks need an agent, which calls tools in a loop (one call or 200), or a workflow that chains calls. Both often need checkpointing and human approval steps.
Frameworks supply tool-calling loops, state, error handling and retries, plus often orchestration, memory, compaction and multi-provider support. The team names three Python options. Microsoft Agent Framework merges Semantic Kernel and Autogen and suits Azure developers. LangChain v1 is rebuilt around agents on top of LangGraph. Pydantic AI stresses type safety and supports OpenTelemetry, A2A and MCP.
Their basic agents look alike: a system prompt, tools and user input. Check each one’s extensibility, since you’ll eventually push past defaults. Middleware that lets you intercept a model response is one sign of a flexible framework.
A short decision guide
The first question is whether you need an agentic loop at all. If you can write the steps down in advance, call the OpenAI or Anthropic API directly. You write more code but get full control and new features as they ship. Use LiteLLM or lm15 only if you really need one code path across vendors. If the model must choose tools, order and finish line, a framework starts to pay off. Whichever you pick, plan to revisit it as new models arrive.
Source: Command Line