Microsoft: Phi 4
This model is no longer available.Add AI to your application with Puter.js.
Explore Other ModelsModel Card
Phi-4 is a 14B parameter small language model from Microsoft that excels at complex reasoning tasks, especially mathematics, outperforming many larger models on math competition benchmarks while being efficient enough for edge deployment.
Context Window 16K
tokens
Max Output 15K
tokens
Input Cost $0.07
per million tokens
Output Cost $0.14
per million tokens
Input text
modalities
Tool Use No
Release Date Jan 10, 2025
Output Speed 42
tokens / sec
Latency 2.45s
time to first token
Code Example
Add AI to your app with the Puter.js AI API, no API keys or setup required.
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
puter.ai.chat("Explain quantum computing in simple terms").then(response => {
document.body.innerHTML = response.message.content;
});
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.chat("Explain quantum computing in simple terms").then(response => {
document.body.innerHTML = response.message.content;
});
</script>
</body>
</html>
Frequently Asked Questions
Phi 4 is no longer available through Puter.js. Explore other AI models for alternatives.
| Price per 1M tokens | |
|---|---|
| Input | $0.07 |
| Output | $0.14 |
Phi 4 was created by Microsoft and released on Jan 10, 2025.
Phi 4 supports a context window of 16K tokens. For reference, that is roughly equivalent to 33 pages of text.
Phi 4 can generate up to 15K tokens in a single response.
Phi 4 accepts the following input types: text. It produces: text.
No, Phi 4 does not currently support tool use (function calling).
Yes — the Phi 4 API works with any JavaScript framework, Node.js, or plain HTML through Puter.js. Just include the library and start building. See the documentation for more details.
Get started with Puter.js
Add AI to your application without worrying about API keys or setup.
Explore Models View Tutorials