Ship a Full-Stack App with One Prompt

Copy this prompt into your AI coding agent, or open it in one below.

Give this to your AI Create a to-do list app using Puter.js

Coding manually? see the guide

Microsoft: Phi 4

This model is no longer available.

Add AI to your application with Puter.js.

Explore Other Models

Model 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

How do I use Phi 4?

Phi 4 is no longer available through Puter.js. Explore other AI models for alternatives.

What is the pricing for Phi 4?
Phi 4 costs $0.07 per 1M input tokens and $0.14 per 1M output tokens.
Price per 1M tokens
Input$0.07
Output$0.14
Who created Phi 4?

Phi 4 was created by Microsoft and released on Jan 10, 2025.

What is the context window of Phi 4?

Phi 4 supports a context window of 16K tokens. For reference, that is roughly equivalent to 33 pages of text.

What is the max output length of Phi 4?

Phi 4 can generate up to 15K tokens in a single response.

What types of input can Phi 4 process?

Phi 4 accepts the following input types: text. It produces: text.

Does Phi 4 support tool use (function calling)?

No, Phi 4 does not currently support tool use (function calling).

Does it work with React / Vue / Vanilla JS / Node / etc.?

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