MI
Microsoft: Phi 4 Mini Instruct
Phi-4-mini-instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4...
text
Specifications
| Context Window | 128K |
| Modalities | text |
| Status | available |
| Category | third-party |
| Model ID | microsoft/phi-4-mini-instruct |
Quick Start
TypeScript
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: process.env.HANZO_API_KEY,
baseURL: 'https://api.hanzo.ai/v1'
})
const response = await client.chat.completions.create({
model: 'microsoft/phi-4-mini-instruct',
messages: [{ role: 'user', content: 'Hello!' }]
})
console.log(response.choices[0].message.content)Python
from openai import OpenAI
client = OpenAI(
api_key=os.environ["HANZO_API_KEY"],
base_url="https://api.hanzo.ai/v1"
)
response = client.chat.completions.create(
model="microsoft/phi-4-mini-instruct",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)cURL
curl https://api.hanzo.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $HANZO_API_KEY" \
-d '{
"model": "microsoft/phi-4-mini-instruct",
"messages": [{"role": "user", "content": "Hello!"}]
}'Go
package main
import (
"context"
"fmt"
"os"
"github.com/sashabaranov/go-openai"
)
func main() {
cfg := openai.DefaultConfig(os.Getenv("HANZO_API_KEY"))
cfg.BaseURL = "https://api.hanzo.ai/v1"
client := openai.NewClientWithConfig(cfg)
resp, _ := client.CreateChatCompletion(context.Background(),
openai.ChatCompletionRequest{
Model: "microsoft/phi-4-mini-instruct",
Messages: []openai.ChatCompletionMessage{
{Role: openai.ChatMessageRoleUser, Content: "Hello!"},
},
},
)
fmt.Println(resp.Choices[0].Message.Content)
}More from Microsoft
Microsoft: Phi 4
16K[Microsoft Research](/microsoft) Phi-4 is designed to perform well in complex reasoning tasks and can operate efficiently in situations with limited memory or where quick responses are needed. At 14 billion...
WizardLM-2 8x22B
66KWizardLM-2 8x22B is Microsoft AI's most advanced Wizard model. It demonstrates highly competitive performance compared to leading proprietary models, and it consistently outperforms all existing state-of-the-art opensource models. It is...
Use Microsoft: Phi 4 Mini Instruct via Hanzo AI
One API key. 390+ models. OpenAI-compatible. Start free.