Inspiration

AI providers face intense GPU costs. They must monetize their users early or go broke. But monetization means blocking access to half the world's human population and all the new cyborgs. AI4ALL gives AI developers tools to make their app available for all - humans and agents, alike.

What it does

AI4ALL charges per/api call for access to and use of AI compute resources including OPENAI_API_KEYs and open source models running on GPUS. The payments use the bitcoin lightning network, so senders/users achieve cryptographically perfect privacy: the developer only knows that the user paid them for their use of the AI service, nothing else. Lightning payments are instant so do not encumber the user experience and can use L402 macaroons to caveat access and uses of payments for specific purposes by the agents.

Most people will not be able to run models locally, and current hosting providers require you to KYC and go through regulated 3rd parties. AI4ALL is an intermediary solution: tech savvy users with beefier hardware can easily and straightforwardly sell per-use-access to their AI models and learn nothing about the users except that they've been paid.

How we built it

We used McKay Wrigley's opensource Chatbot-UI for the frontend, but routed the backend to a GPT4ALL webserver to run locally hosted open source models like wizard and GPT4-J.

We wrapped Langchain's APIChain with L402 (payment required) aware requests to encumber chains with payments per use, so the user can deploy publicly using their own keys and always be profitable. L402s allow us to give agents access to bitcoin to make payments like provision GPUs to run bigger models or purchase access to useful datasets while leaving the user in control of configuring the AI agent's budgeting and access.

AI4ALL uses the Bitcoin Lightning Network to achieve instant, final settlement of payments using a permissionless finanical layer available to anyone with an internet connection. We used Alby, a bitcoin lightning extension for in-browser native access to Lightning, and Aperture, an API gating system for making specific API calls charge different amounts so the developer can host and offer more complex AI services like complex chains with Langchain while always remaining profitable because the users pay per use for each service.

Built With

Share this project:

Updates