Skip to main content
text generation

Phi-3-mini-4k-instruct

by microsoft

license: mit

367,701 downloads1,475 likes
Get API Key

API Usage

Endpoint

POST https://api.gpu.fm/v1/inference

Request

curl -X POST https://api.gpu.fm/v1/inference \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "microsoft/Phi-3-mini-4k-instruct",
    "inputs": "Explain the theory of relativity in simple terms",
    "parameters": {
      "max_new_tokens": 256
    }
  }'

Response

{
  "result": "Albert Einstein's theory of relativity...",
  "usage": {
    "inputTokens": 12,
    "outputTokens": 128
  },
  "pricing": {
    "total": "0.000018"
  }
}

Python SDK

import requests

response = requests.post(
    "https://api.gpu.fm/v1/inference",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "microsoft/Phi-3-mini-4k-instruct",
        "inputs": "Explain the theory of relativity in simple terms",
        "parameters": {"max_new_tokens": 256}
    }
)

result = response.json()
print(result["result"])

Model Documentation

Full documentation available on HuggingFace →

Pricing

Input$0.13/1M tokens
Output$0.39/1M tokens

Billed from your prepaid credits. No minimum commitment.

Details

Model ID
microsoft/Phi-3-mini-4k-instruct
Library
transformers
Pipeline
text generation
Updated
12/10/2025

Tags

transformerssafetensorsphi3text-generationnlpcodeconversationalcustom_codeenfr