The React Library
to build
AI apps

Polyfire is a React library for LLM orchestration.
But the hooks and components work with an API - your "AI Backend".
Everything is open source.

  1. 1. React Library (like LangChain)
  2. 2. Hosted API
    1. a. Users Management (auth, rate limits, payments)
    2. b. Models Router (like OpenRouter.ai)
    3. c. Data Service (vector store, embeddings, key value)
    4. d. Prompt Engineering Tool (logs, playground, prompt variables)

Code Examples

setup

1 2 3 4 5 6 7 import { PolyfireProvider } from "polyfire-js"; root.render( <PolyfireProvider project="your_project_alias"> <App /> </PolyfireProvider> );

useChat

1 2 3 4 const { messages, sendMessage, loading } = useChat(); sendMessage("Hello world!"); if (!loading) console.log(messages);

useAgent

1 2 3 4 const { start, stop } = useAgent(actions, { provider: "openai", model: "gpt-4", });

text generation

1 2 3 4 5 const { models } = usePolyfire(); const { generate } = models; const haiku = await generate("Generate a hello world haiku"); console.log(haiku);

embeddings

1 2 3 4 5 const { data } = usePolyfire(); const { Embeddings } = data; const embeddings = Embeddings(); memory.add("I really like the couleur blue.");

Polyfire =
React SDK
+ Managed Backend
+ Dashboard

FeatureWhat it isReplacing what
hooks, components
vercelai

AI SDK

🦜🔗 LangChain
many models, one API
APIs of (
whatevwhatevwhatevwhatev
)
vector store, embeddings, key value
OR
chroma ChromaDB
prompts variables, logs, playground
🦜🛠️ LangSmith
nat.dev

And you get logs, metrics, and a nice dashboard for all of this.

logo_lockup_firebase_horizontalCreated with Sketch.Web Apps
Polyfire Logo
AI Apps

Frequently asked questions

If you can’t find what you’re looking for, join our Discord, ask your question, and someone will help you.

    • When is Polyfire most useful?

      Polyfire is most useful for hackathons. With a React app and Polyfire you can go from idea to production super fast. It's one SDK for a maximum of options.

    • What is different with LangChain, Vercel AI, and Pinecone?

      Polyfire is all those things in one JavaScript SDK. Of course we don't support yet all their features, but what matters is that we are much simpler and faster to use.

    • Do I pay you? Or do I pay the APIs? (OpenAI, ElevenLabs, etc.)

      You can chose. One option is to buy Polyfire credits & we will handle the billing for the APIs you use. Another is to save your API keys on the dashboard.

    • Are you hiring?

      Yes! We are hiring for 2 full-time role in SF. Google 9-9-6, if that's your thing, reach out at victor at polyfire dot com.

    • Why client-side? How does it work?

      Having two codebase is double the work. Keeping your stack lean help ship faster and maintain better. With Polyfire, you create user-sessions and then your app logic is authenticated.

    • Is Polyfire free?

      We are always happy to give free credits, but otherwise it's $25 a month + API costs.

    • What is your goal?

      The goal is to vertically integrate as many AI services into one Library. To give a DevX similar to what Vercel/Next.js, Firebase or Expo have done.

    • Are you open source?

      Yes! Check out our GitHub. The GoLang API (the managed backend) and the JavaScript SDK are both open to PRs & issues.