Microsoft Phi and Inception Mercury Are Now Available in Puter.js
We're excited to announce that Puter.js now supports Microsoft Phi and Inception Mercury, giving developers free, unlimited access to cutting-edge AI models that redefine what's possible with small language models and diffusion-based generation.
Microsoft Phi: Powerful Small Language Models
Microsoft Phi represents a paradigm shift in AI efficiency. These small language models (SLMs) deliver frontier-level capabilities while being optimized for speed, cost-effectiveness, and flexible deployment—from cloud to edge to on-device.
All Phi models feature ultra-low latency, extensive customization options, and are built following Microsoft's AI principles of accountability, transparency, fairness, and security.
// Complex reasoning with Phi 4
puter.ai.chat("Explain quantum entanglement and its implications",
{ model: 'microsoft/phi-4' });
// Image analysis with Phi 4 Multimodal
puter.ai.chat("Describe this image", "https://example.com/image.jpg",
{ model: 'microsoft/phi-4-multimodal-instruct' });
Inception Mercury: Revolutionary Speed Through Diffusion
Mercury introduces the world's first commercial-scale diffusion large language model (dLLM), achieving speeds up to 10x faster than traditional autoregressive models.
What Makes Mercury Different:
Unlike standard language models that generate text one token at a time, Mercury uses a coarse-to-fine diffusion process that refines outputs from noise over multiple steps. This enables blazing speeds (over 1,000 tokens/second), holistic reasoning across entire outputs, continual error correction, and true parallel processing of multiple tokens at once.
// Fast text generation with Mercury
puter.ai.chat("Explain machine learning simply",
{ model: "inception/mercury" });
// High-speed code generation with Mercury Coder
puter.ai.chat("Write a React component for a todo list",
{ model: "inception/mercury-coder" });
Get Started Now
Just add one script tag to your HTML:
<script src="https://js.puter.com/v2/"></script>
No sign-ups, no API keys, no infrastructure setup. Start building with Microsoft Phi and Inception Mercury immediately.
Try All Models
Here's a simple demo to test all the introduced models:
<!DOCTYPE html>
<html>
<head>
<script src="https://js.puter.com/v2/"></script>
</head>
<body>
<h1>Microsoft Phi & Mercury Demo</h1>
<h2>Microsoft Phi Models</h2>
<button onclick="testPhi4()">Phi 4 - Complex Reasoning</button>
<button onclick="testPhi4Plus()">Phi 4 Reasoning Plus</button>
<button onclick="testPhi4MM()">Phi 4 Multimodal</button>
<button onclick="testPhi4Mini()">Phi 4 Mini</button>
<button onclick="testPhi35()">Phi 3.5</button>
<button onclick="testPhi3()">Phi 3</button>
<h2>Mercury Models (Ultra-Fast)</h2>
<button onclick="testMercury()">Mercury</button>
<button onclick="testMercuryCoder()">Mercury Coder</button>
<div id="result" style="margin-top: 20px; padding: 15px; border: 1px solid #ccc;"></div>
<script>
async function testPhi4() {
showResult("Testing Phi 4...");
const response = await puter.ai.chat("Solve: If a train travels 60mph for 2 hours then 80mph for 1 hour, what's the average speed?",
{ model: "microsoft/phi-4" });
showResult(`Phi 4: ${response}`);
}
async function testPhi4Plus() {
showResult("Testing Phi 4 Reasoning Plus...");
const response = await puter.ai.chat("Plan a 3-course dinner for 6 people with $100 budget. Include shopping list.",
{ model: "microsoft/phi-4-reasoning-plus" });
showResult(`Phi 4 Plus: ${response}`);
}
async function testPhi4MM() {
showResult("Testing Phi 4 Multimodal...");
const response = await puter.ai.chat("Describe what you see", "https://picsum.photos/300/200",
{ model: "microsoft/phi-4-multimodal-instruct" });
showResult(`Phi 4 Multimodal: ${response}`);
}
async function testPhi35() {
showResult("Testing Phi 3.5...");
const response = await puter.ai.chat("Explain recursion with a simple example",
{ model: "microsoft/phi-3.5-mini-128k-instruct" });
showResult(`Phi 3.5: ${response}`);
}
async function testPhi3() {
showResult("Testing Phi 3...");
const response = await puter.ai.chat("Write a Python function to reverse a string",
{ model: "microsoft/phi-3-mini-128k-instruct" });
showResult(`Phi 3: ${response}`);
}
async function testMercury() {
showResult("Testing Mercury (watch the speed!)...");
const start = Date.now();
const response = await puter.ai.chat("Write a creative story about AI in exactly 100 words",
{ model: "inception/mercury" });
const time = ((Date.now() - start) / 1000).toFixed(2);
showResult(`Mercury (${time}s): ${response}`);
}
async function testMercuryCoder() {
showResult("Testing Mercury Coder (ultra-fast coding!)...");
const start = Date.now();
const response = await puter.ai.chat("Create a JavaScript function to validate email addresses",
{ model: "inception/mercury-coder" });
const time = ((Date.now() - start) / 1000).toFixed(2);
showResult(`Mercury Coder (${time}s): ${response}`);
}
function showResult(text) {
document.getElementById('result').innerHTML = text;
}
</script>
</body>
</html>
This simple demo lets you test all the introduced models with one click each. Notice how Mercury models respond much faster than traditional Phi models!
Learn more:
Free, Serverless AI and Cloud
Start creating powerful web applications with Puter.js in seconds!
Get Started Now