Free, Unlimited AllenAI API
On this page
In this tutorial, you will learn how to integrate AllenAI's models into your application using Puter.js. You can gain access to AllenAI's open language models such as Olmo 3.1, and more without having to set up the AI server yourself.
Puter.js uses the User-Pays model, where users of your application cover their own AI costs. This means you as a developer don't pay anything for your users' usage, making your app practically free to run. You can scale to unlimited users and pay nothing for the AI or server usage.
Getting Started
To use Puter.js, import our NPM library in your project:
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
Or alternatively, add our script via CDN if you are working directly with HTML, simply add it to the <head> or <body> section of your code:
<script src="https://js.puter.com/v2/"></script>
That's it, you're ready to start integrating AllenAI open language models into your application.
Example 1: Chat with Olmo 3.1 Instruct
Olmo 3.1 Instruct is a supervised instruction-fine-tuned variant of the Olmo models, optimized for instruction-following, question-answering, and natural conversational dialogue.
puter.ai.chat("Explain the concept of quantum computing in simple terms",
{ model: "allenai/olmo-3.1-32b-instruct" }
)
.then(response => {
puter.print(response);
});
Full code example:
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.chat("Explain the concept of quantum computing in simple terms",
{ model: "allenai/olmo-3.1-32b-instruct" }
)
.then(response => {
puter.print(response);
});
</script>
</body>
</html>
Example 2: Streaming Responses
For longer responses, use streaming to get results in real-time:
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
async function streamResponse() {
const response = await puter.ai.chat(
"Write a short essay about the future of artificial intelligence.",
{ model: "allenai/olmo-3.1-32b-instruct", stream: true }
);
for await (const part of response) {
puter.print(part?.text);
}
}
streamResponse();
</script>
</body>
</html>
List of AllenAI models
You can use the following AllenAI models with Puter.js:
allenai/olmo-2-0325-32b-instruct
allenai/olmo-3-32b-think
allenai/olmo-3.1-32b-instruct
Conclusion
Using Puter.js, you can gain access to AllenAI's open language models without having to set up the AI server yourself. And thanks to the User-Pays model, your users cover their own AI usage, not you as the developer. This means you can build powerful applications without worrying about AI usage costs.
You can find all AI features supported by Puter.js in the documentation.
Related
Free, Serverless AI and Cloud
Start creating powerful web applications with Puter.js in seconds!
Get Started Now