Microsoft Phi 4 Mini 3.8B inference overview

Price per 1M tokens

$0.08 (input)
$0.35 (output)

Parameters

3.8B

Context Window

128K

Release Date

Feb 2025

Microsoft Phi 4 Mini 3.8B inference details

Phi 4 Mini is optimized for use in lightweight environments, excelling at quick interactions, and constrained-resource deployments. It supports strong mathematical and logical inference, suitable for embedded applications, mobile environments, or real-time AI assistants.

Created by: 

Microsoft

License: 

mit

Model card: 

import openai
import weave

# Weave autopatches OpenAI to log LLM calls to W&B
weave.init("/")

client = openai.OpenAI(
    # The custom base URL points to W&B Inference
    base_url='https://api.inference.wandb.ai/v1',

    # Get your API key from https://wandb.ai/authorize
    # Consider setting it in the environment as OPENAI_API_KEY instead for safety
    api_key="",

    # Team and project are required for usage tracking
    project="/",
)

response = client.chat.completions.create(
    model="microsoft/Phi-4-mini-instruct",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Tell me a joke."}
    ],
)

print(response.choices[0].message.content)

Microsoft Phi 4 Mini 3.8B resources

Screenshot 2025-07-30 at 1.03.14 PM
Course
AI engineering course: Agents
Inference_logo
Guide
W&B Inference powered by CoreWeave
Screenshot 2025-07-30 at 8.00.14 AM
Whitepaper
A primer on building successful AI agents