β‘ An all-in-one managed backend for AI apps. Build AI apps from the frontend, very fast. πͺΆ
Why use Polyfire?
- Just code from the frontend, no backend needed
- If you already have backend, less code to write
- Most backend services you'd need in a couple lines of code
We manage your AI backend so you don't have to.
We have several examples in our documentation. But here are two simple ones to get you started
import { useState, useEffect } from "react";
import { createRoot } from "react-dom/client";
import { TextGenerated, Login } from "polyfire-js/components";
function App() {
return (
<Login>
<h2>Here's a little auto-generated haiku for you:</h2>
<TextGenerated prompt="Generate a hello world haiku" />
</Login>
);
}
document.body.innerHTML = '<div id="app"></div>';
const root = createRoot(document.getElementById("app"));
root.render(
<PolyfireProvider project="your_project_id">
<App />
</PolyfireProvider>,
);
Don't forget to change the your_project_id by your project ID you will have got on https://beta.polyfire.com
<script src="https://github.com/polyfire-ai/polyfire-js/releases/download/0.2.7/polyfire-min-0.2.7.js"></script>
<script>
(async () => {
const polyfire = window.PolyfireClientBuilder({ project: "your_project_id" });
const isAuthenticated = await polyfire.auth.init();
if (!isAuthenticated) {
await polyfire.auth.login("github");
}
const helloWorld = await polyfire.models.generate("Write me a hello world haiku");
console.log(helloWorld);
})();
</script>
Don't forget to change the your_project_id by your project ID you will have got on https://beta.polyfire.com
To get an overview of Polyfire follow this Basic Usage tutorial.
We also made a couple of tutorials you can use to get started with Polyfire:
- How to make a clone of ChatGPT
- New Project & Rate Limits
- Adding stripe subscriptions
- Call Polyfire from React: The usePolyfire hooks lets you use Polyfire and handle authentification without having to deploy any backend
- Call Polyfire from other browser environments: The Polyfire Client Object allows you to use Polyfire and handle authentification without having to deploy any backend in any environment
- Generate Simple Text: Answer to simple requests as text
- Create Chatbots: Easily create chatbots
- Transcribe: Transcribe audio files to text
- Memory: Easily create a long-term memory and simplify the use of large amounts of information
- GenerateImage: Generate images with Dall-E
- Website: polyfire.com
- Documentation: docs.polyfire.com
- Dashboard: beta.polyfire.com
- Discord: polyfire.com/discord
- Javascript SDK: github.com/polyfire-ai/polyfire-js
- Open Source API (your managed backend!): github.com/polyfire-ai/polyfire-api
We're open source! Make a good PR to the JS SDK or the API and we'll merge it.