Phi-4

Phi-4 is a modern open-source language model with 14 billion parameters. Although the architectural changes compared to previous versions are minimal, the model demonstrates significant progress in tasks requiring logical thinking and analytical skills, made possible by an innovative training approach. Unlike traditional language model training methods, Phi-4 focuses not on the quantity of data but on its quality. The training of Phi-4 utilized diverse sources, including synthetic data specifically designed to develop reasoning skills, filtered documents from public sources, as well as acquired academic books and question-answer knowledge bases. This allows the model to achieve high performance even with a relatively small size.  

Phi-4 works exclusively with textual data. Its context window is relatively small at 16K tokens, but it supports more than 50 languages, including Russian.  

Overall, Phi-4 is a versatile lightweight model, but according to its developers, it is particularly effective in environments with limited memory and computational resources, as well as for tasks requiring instant response.


Announce Date: 12.12.2024
Parameters: 14.7B
Context: 16K
Attention Type: Full Attention
VRAM requirements: 10.0 GB using 4 bits quantization
Developer: Microsoft
Transformers Version: 4.47.0
License: MIT

Public endpoint

Use our pre-built public endpoints to test inference and explore Phi-4 capabilities.
Model Name Context Type GPU TPS Status Link
phi-4 16,000.0 Public RTX3090 31.50 AVAILABLE try

API access to Phi-4 endpoints

curl https://chat.immers.cloud/v1/endpoints/phi-4/generate/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer USER_API_KEY" \
-d '{"model": "phi-4", "messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Say this is a test"}
], "temperature": 0, "max_tokens": 150}'
$response = Invoke-WebRequest https://chat.immers.cloud/v1/endpoints/phi-4/generate/chat/completions `
-Method POST `
-Headers @{
"Authorization" = "Bearer USER_API_KEY"
"Content-Type" = "application/json"
} `
-Body (@{
model = "phi-4"
messages = @(
@{ role = "system"; content = "You are a helpful assistant." },
@{ role = "user"; content = "Say this is a test" }
)
} | ConvertTo-Json)
($response.Content | ConvertFrom-Json).choices[0].message.content
#!pip install OpenAI --upgrade

from openai import OpenAI

client = OpenAI(
api_key="USER_API_KEY",
base_url="https://chat.immers.cloud/v1/endpoints/phi-4/generate/",
)

chat_response = client.chat.completions.create(
model="phi-4",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Say this is a test"},
]
)
print(chat_response.choices[0].message.content)

Private server

Rent your own physically dedicated instance with hourly or long-term monthly billing.

We recommend deploying private instances in the following scenarios:

  • maximize endpoint performance,
  • enable full context for long sequences,
  • ensure top-tier security for data processing in an isolated, dedicated environment,
  • use custom weights, such as fine-tuned models or LoRA adapters.

Recommended configurations for hosting Phi-4

Prices:
Name vCPU RAM, MB Disk, GB GPU Price, hour
rtx2080ti-1.16.32.160 16 32768 160 1 $0.41 Launch
teslat4-1.16.16.160 16 16384 160 1 $0.46 Launch
teslaa10-1.16.32.160 16 32768 160 1 $0.53 Launch
teslaa2-2.16.32.160 16 32768 160 2 $0.57 Launch
rtx3090-1.16.24.160 16 24576 160 1 $0.88 Launch
rtx3080-2.16.32.160 16 32762 160 2 $0.97 Launch
rtx4090-1.16.32.160 16 32768 160 1 $1.15 Launch
teslav100-1.12.64.160 12 65536 160 1 $1.20 Launch
rtx5090-1.16.64.160 16 65536 160 1 $1.59 Launch
teslaa100-1.16.64.160 16 65536 160 1 $2.58 Launch
teslah100-1.16.64.160 16 65536 160 1 $5.11 Launch
Prices:
Name vCPU RAM, MB Disk, GB GPU Price, hour
teslaa10-1.16.32.160 16 32768 160 1 $0.53 Launch
teslaa2-2.16.32.160 16 32768 160 2 $0.57 Launch
rtx2080ti-2.12.64.160 12 65536 160 2 $0.69 Launch
teslat4-2.16.32.160 16 32768 160 2 $0.80 Launch
rtx3090-1.16.24.160 16 24576 160 1 $0.88 Launch
rtx3080-2.16.32.160 16 32762 160 2 $0.97 Launch
rtx4090-1.16.32.160 16 32768 160 1 $1.15 Launch
teslav100-1.12.64.160 12 65536 160 1 $1.20 Launch
rtx5090-1.16.64.160 16 65536 160 1 $1.59 Launch
teslaa100-1.16.64.160 16 65536 160 1 $2.58 Launch
teslah100-1.16.64.160 16 65536 160 1 $5.11 Launch
Prices:
Name vCPU RAM, MB Disk, GB GPU Price, hour
teslaa10-2.16.64.160 16 65536 160 2 $0.93 Launch
rtx2080ti-4.16.64.160 16 65536 160 4 $1.18 Launch
teslat4-4.16.64.160 16 65536 160 4 $1.48 Launch
rtx3090-2.16.64.160 16 65536 160 2 $1.67 Launch
rtx3080-4.16.64.160 16 65536 160 4 $1.82 Launch
rtx4090-2.16.64.160 16 65536 160 2 $2.19 Launch
teslav100-2.16.64.240 16 65535 240 2 $2.22 Launch
teslaa100-1.16.64.160 16 65536 160 1 $2.58 Launch
rtx5090-2.16.64.160 16 65536 160 2 $2.93 Launch
teslah100-1.16.64.160 16 65536 160 1 $5.11 Launch

Related models

Need help?

Contact our dedicated neural networks support team at nn@immers.cloud or send your request to the sales department at sale@immers.cloud.