polyfire-js

polyfire-js

ðŸ”Ĩ React library of AI components ðŸ”Ĩ

Stars: 126

Visit
 screenshot

Polyfire is an all-in-one managed backend for AI apps that allows users to build AI applications directly from the frontend, eliminating the need for a separate backend. It simplifies the process by providing most backend services in just a few lines of code. With Polyfire, users can easily create chatbots, transcribe audio files, generate simple text, manage long-term memory, and generate images. The tool also offers starter guides and tutorials to help users get started quickly and efficiently.

README:

ðŸ”Ĩ polyfire

⚡ 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.

Demo Gif

🧰 Examples

We have several examples in our documentation. But here are two simple ones to get you started

React

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

Vanilla JS

<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

🆕 Getting Started

To get an overview of Polyfire follow this Basic Usage tutorial.

âœĻ Starter Guides

We also made a couple of tutorials you can use to get started with Polyfire:

📚 Useful References

🔗 Links

We're open source! Make a good PR to the JS SDK or the API and we'll merge it.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for polyfire-js

Similar Open Source Tools

For similar tasks

For similar jobs