LLM ReferenceLLM Reference
Microsoft Foundry

Using Phi-2 on Microsoft Foundry

Implementation guide · Phi-2 · Microsoft Research

ProvisionedOpen Source

Quick Start

  1. 1
    Create an account at Microsoft Foundry and generate an API key.
  2. 2
    Use the Microsoft Foundry SDK or REST API to call phi-2 — see the documentation for request format.
  3. 3
    You'll be billed $0.07/1M input, $0.07/1M output tokens.

About Microsoft Foundry

Microsoft Foundry offers a comprehensive platform-as-a-service for enterprise AI operations. It provides multiple deployment options including Serverless APIs (pay-as-you-go), Global Standard (shared managed capacity), Provisioned Throughput Units (reserved capacity), batch processing, and bring-your-own model deployments. The platform features a unified control plane for models, agents, tools, and observability. Its Agent Service enables building and deploying AI agents with built-in tracing, monitoring, and governance. Evaluation and monitoring tools assess model performance, safety, and groundedness. Foundry supports seamless upgrades from Azure OpenAI with non-destructive migration, maintaining existing deployments while unlocking multi-provider model access and advanced platform capabilities.

Microsoft Foundry is a unified enterprise AI platform that significantly expands beyond Azure OpenAI. It functions as a multi-provider hosting and deployment platform for LLMs, supporting models from OpenAI, Anthropic, DeepSeek, xAI, Meta, Mistral, NVIDIA, and others. Foundry integrates agent services, evaluation, observability, and governance into a single Azure control plane. Key capabilities include a multi-provider model catalog, Model Router for intelligent prompt routing, Foundry Agent Service for building and deploying AI agents with built-in tracing and monitoring, and enterprise-grade governance with RBAC, compliance, and regional deployments. For broader model catalog including Claude, DeepSeek, Grok, Llama, Mistral, and NVIDIA Nemotron, Foundry is the recommended platform over Azure OpenAI.

Pricing on Microsoft Foundry

TypePrice (per 1M)
Input tokens$0.07
Output tokens$0.07

Capabilities

VisionMultimodalReasoningFunction CallingTool UseStructured OutputsCode Execution

About Phi-2

Phi-2 is a compact language model by Microsoft endowed with 2.7 billion parameters and part of their Phi series. It shows formidable capabilities in reasoning and language understanding, outshining much larger models, even those with up to 25 times more parameters. Phi-2's training utilized a vast and diverse dataset of 1.4 trillion tokens, incorporating high-quality synthetic data and curated web content to bolster its common sense reasoning and general knowledge. Interestingly, despite lacking fine-tuning via reinforcement learning from human feedback (RLHF), it exhibits enhanced safety features and reduced bias. This makes Phi-2 a particularly useful asset in natural language processing research and development 127.

Model Specs

Released2023-12-12
Parameters2.7B
ArchitectureDecoder Only

Provider

Microsoft Foundry
Microsoft Foundry

Microsoft

Redmond, Washington, United States