Oddbean new post about | logout
 We are excited to unveil the alpha version of our PlebAI TypeScript SDK. This toolkit has been designed to simplify and optimize the integration of PlebAI agents into your projects and websites.

## Delving into PlebAI
Think of PlebAI as the people's answer to ChatGPT, but it links exclusively to open-source, extensive language models. Skip the hassle of email and credit card details; all agents operates without mandatory registration and accepts payments solely through Bitcoin and its Lightning Network. These open-source language models (LLMs) are unbiased and aren't tuned to generate a predetermined set of responses. With its focus on open-source avenues, PlebAI promises transparency and is steered by the community. Users can confidently rely on the information sourced, knowing it's free from external biases or proprietary modifications. PlebAI's dedication to neutrality establishes it as a reliable platform for impartial knowledge and assistance.
​
## What does PlebAI-SDK do for me?

### Communication
PlebAI agents operate on the nostr protocol, guaranteeing conversations that are not only end-to-end encrypted but also resilient against censorship. The PlebAI SDK has been designed with user-friendliness in mind; it facilitates easy connectivity to an agent, all while bypassing the intricacies of the nostr protocol. The declarative API it offers ensures a smooth flow of sending and receiving messages.
​
```ts
const conv = new Conversation("<Agent Key>", ["<List of Relays>"] {useWebLn: false});
​
conv.sub(
    (event, message) => {
        console.log(event);
        console.log(message);
    },
    (paymentRequest) => {
        console.log(paymentRequest);
    }
);
​
conv.sendPrompt("Write a text about artificial intelligence");
```
​
### Payment Handling
From the showcased example, it's evident that our SDK provides a systematic approach to manage paymentRequests received from an agent. But there's more: the PlebAI-SDK can be paired with webLN automatically. WebLN, a robust JavaScript interface for the Bitcoin Lightning Network, allows the SDK to communicate seamlessly with a webLN provider, subsequently prompting the user for a payment. This refined integration eliminates complexities associated with payment handling, ensuring a hassle-free experience.
​
## The Journey Ahead
Launching the alpha is just our initial step in a long and promising journey. As we evolve, the PlebAI-SDK aims to be the foundational gateway to PlebAI development for JavaScript enthusiasts. Our roadmap is expansive, encompassing not only enhancements for an enriched user experience but also tools tailored for intricate use cases—like crafting and launching bespoke agents.
​
## Let's Make PlebAI-SDK Better, Together
As we keep working on the PlebAI-SDK, your input and experience matter to us. PlebAI-SDK is FOSS — it's built on community feedback and collaboration. We encourage developers to give the SDK a try and share any feedback you have. Your insights help us improve and ensure the toolkit meets your needs.
​
If you're comfortable with open-source contributions and spot something you'd like to enhance or fix, please don't hesitate. Every contribution, big or small, makes a difference.
​
[PlebAI-SDK on Github](https://github.com/lightning-digital-entertainment/plebai-ts)
[PlebAI-SDK on NPM](https://www.npmjs.com/package/plebai-sdk)