Get paid for your Streamlit Generative AI App!

Get paid for your Streamlit Generative AI App!!

(With or without the GPT Store!) :upside_down_face:

Background :robot: :dollar: :thinking:

As the Streamlit community builds more and more useful GPTs, and as more generative AI powered apps emerge, getting paid for your app will be critical in turning your AI into a business. But simply integrating Stripe for payments may not be enough…for example, how do you ensure that what your users pay is enough to cover your AI costs with OpenAI, Langchain, etc.? The last thing any Builder wants is to be stuck with bills from AI vendors at the end of the month that they struggle to cover.

Nevermined wants to fix this.

Mission :+1:

We’ve made it our mission to help AI Builders get paid as simply as possible so that they can focus on what really matters: building an amazing gen-AI app for their users.

Solution :partying_face: :tada:

Try the test version of the Solution now! :rocket: :dizzy:

We’re building a Streamlit solution that will enable AI Builders to set up subscription plans to accept payments and manage the usage of their apps, AI agents and GPTs, all from their Streamlit Gen-AI app.

The solution works by creating your own credits backend that integrates with any AI offering, like ChatGPT, Langchain, Llama Index, etc., and lets you manage control of your app usage.

The best part? You, the Builder, is in control of everything! You set the price, the duration for access, the number of accesses, etc. You just create a subscription plan, set the parameters for access, and start selling credits to your users.

Want to sell multiple tiers with varying discounts depending on the tier? You can do it.

Want to sell time-based access AND request-based access to your AI app? You can do that too!

And the icing on the cake? The solution comes ready-built with reporting so you can understand how your users are using your AI app, and then optimize to support their usage! Want to know what your power users are doing and connect with them? You can do that with this solution!

We want to enable Builders to have control over their AI apps in any permutation, but without the complexity of having to build it yourself!

Disclosure

The app is still in Alpha release mode. Currently the solution is only available via our staging application, including Stripe Testing integration. We plan to have the full production release by the end of January.

We’d love for everyone to try the application and let us know what you think. Your feedback is invaluable as it will help us streamline the application for your use. Please let us know what you think!

See how the Gen-AI Streamlit Subscription works:

First here’s a short demo of the Gen-AI Streamlit Subscription app and how it works with Stripe payments:

Streamlit App DG

For the full length demo video, please see this.

In this video, you will see how a user is prompted via your Gen-AI Streamlit app to first log into your app. Once logged in and authenticated, users without credits will be prompted to subscribe to your AI. You have the choice to set up different subscription options, such as Free and Paid subscription plans. Once a user has subscribed, they will be able to access your AI under the conditions you set via each plan’s subscription prerequisites.

Try the Application Now!

To try the application, please go to our staging app here: Staging Solution.

How to setup a Gen-AI Streamlit Subscription Plan

The following is a step-by-step guide to creating your own Gen-AI Subscription Plan for your Streamlit app. Please note that this product is still a work in progress, and we have not yet made the Stripe payment piece fully available in production. If you would like to use the production Stripe integration to get paid, please contact us on Discord () or at info@nevermined.io.

Step 1 - Set up your Builder Account in Nevermined

  1. Navigate to Nevermined
  2. Click “Log in”

Picture1

  1. Select your sign in method

  1. Once logged in, click the “New” button in the top right, then click the “Create a plan” button.

Step 2 - Set up Stripe

  1. This will prompt you to continue creating your profile, updating it with your designated payment(s) type (i.e. Stripe).

Picture3

  1. If you’d like to use Stripe as your payment gateway, select the Stripe option and click the “Create Stripe account” button

Picture4

  1. Now you will set up your Stripe account

a. First enter your email and verify your phone number

b. Next, describe your business for Stripe, including your business and personal details. This will help Stripe onboard you into their system.
c. Once you’ve navigated the set up details, click “Agree and submit” to finalize your account set up.

  1. Congratulations! You’ve successfully set up your Stripe account. Now let’s create your first subscription plan.

Picture7

Step 3 - Create a Subscription Plan

  1. Click the “New” button, then the “Create a plan” button

  1. Describe the type of subscription plan you wish to create for your users. For example, you may want to create a subscription plan that allows your users to buy a set number of access credits for a certain price that your users will use to redeem access to your gen-AI Streamlit app.

  1. Next, choose the type of plan you want to enable for your users. Here you have the selection of allowing your users to access your app for a period of time, or by a set number of requests. We’ve also included a set of templates you can use, like Free, time period plans (i.e 1 month, 1 year, etc.), custom plans, etc.

a. Request based plan - you can choose from a number of options, or create your own Custom plan. You are able to edit:

i. The Title - Give your plan a descriptive Subscription title.
ii. Price - Set the price for you credits based plan.
iii. No. of Credits - Set the number of credits your users receive when they buy this plan.

b. Time period based plan - you can choose from a number of options, or create your own Custom plan. You are able to edit:

i. The Title - Give your plan a descriptive Subscription title.
ii. Price - Set the price for you credits based plan.
iii. Duration - Set the duration of time that your users can access your app when they buy this plan. Options include:

* Hours
* Days
* Weeks
* Months
* Years

  1. Now review the subscription plan set up and confirm by clicking “Next”

Step 4 - Specify your Gen-AI Service

  1. Next, you need to link your Gen-AI service, like your OpenAI GPT API, to the plan in order to manage access to your AI service. To do this, click the “Create Content” button.

  1. You start by describing the AI service you want to control access to. To do this, provide a Title, Description and cover image for the Gen-AI service.

  1. Next, add your specific AI service information via your AI’s API information. For example, if your AI is a text-to-text AI using OpenAI’s completion capability, you will register the corresponding OpenAI POST: https://api.openai.com/v1/chat/completions. For other third party AI services, you can register a similar API call.

(Please note that we support the OpenAPI standard for API information. This means that you can also set how you’d like to expose your endpoints.)

  1. Now add what type of security mechanism you’d like to enforce for User Authentication to your AI app. The options include:

  2. No authentication

  3. Basic Authentication with a username and password

  4. Bearer Token authentication with designated access token.

In the case that you are using a third party service, like OpenAI, use the Bearer Token option to register your OpenAI API Key (OPENAI_API_KEY). This can be found from the third party service provider.

(Please note that Nevermined fully encrypts the Bearer Token information that you submit so that this information is never disclosed to anyone but yourse

  1. Now select the subscription plan that you created earlier and attach your AI service to this plan. This will enable the controls you’ve set for your Gen-AI app using this service. In this step you can also set the number of credits needed for each user to make one request for this AI service.

  1. Lastly, review your AI-service setup and click “Create”.

  1. Once you’ve successfully created the AI service, you can see its widget by clicking the “See the asset” button.

Step 5 - Get your Streamlit Embeddable Widget

  1. To create your embeddable widget into your Streamlit app, you will need your unique subscription plan identifier, or DID. You can get this by copying the URL for the AI API / webservice that you just created. To do this, first navigate to “My area → My assets”.

  1. Click the 3 vertical dots for your AI webservice, and select “See Asset”.

  1. From the AI webservice page, copy the URL to use in the next step.

Embedding the Widget into your Streamlit Gen-AI App

Follow the instructions in Github for deploying your widget to Streamlit: GitHub - nevermined-io/streamlit: Nevermined Streamlit component

(Please note: to get your AI’s unique identifier, or DID, you can follow the instructions above from xviii to xx.)

Deployed Widget in you Streamlit Gen-AI App

Once your Widget is deployed to your Streamlit app, it should work like the demo video.

Sit back and get paid with your AI App! :100:

Now you’re ready to get paid. Users that use your Gen-AI App can pay you via Stripe for the application you’ve built for them.

Happy Building!

Support :dizzy_face:

This product is a work in progress. Consequently, some things explained above may be unclear, or may change. If you run into any issues, please contact us by jumping into our Discord or emailing us at info@nevermined.io.

We’d love to hear from you! Connect with us on Discord. :pray:

We’d love to hear from you whether you think this application is helpful or horrible, as well as what we can do to improve what we’re working on. So please join the discussion at our Discord.

64 Likes

Hi! Super interesting, I think making converting streamlit apps into paid apps is something lots of us have been wondering/tinkering.
Would this work only for AI apps, or is it a more general solution (just branded “for AI”)?
Do you have the url of an paid app using it, to test how it feels for the final user? I’d love to play around.

Quick reactions.

  1. Good idea.
  2. Association with crypto is a negative at this point.
  3. I already have a lot of the pieces in place: working stripe integrations, authentication/access controls, bespoke AI apps. I could continue stitching them together without this service. So to be a big win for me, this needs to be very seamless and simple.
  4. Staging is too early for me to test. I’d be in for sure if there was an early access program to a working system.
  5. Set up is a lot of steps (21?). I want something more like 3.

Look forward to seeing more!

Hi @sebastiandres, thanks for the comment! You are correct, this implementation could be used for more than just AI Streamlit apps. We’d love to explore those options as well.

Specifically regarding AI Streamlit apps, one reason we focused here is because of the varying nature of the backend model services, and the different prices of those models. For example, some apps can take in a prompt and then select which model is best suited to provide a response. One prompt might need GPT4 because it needs to return text and images, while another prompt might only need GPT3 to provide a simple QA response. The price for each model differs, so we want to give Builders control over their variable pricing needs.

We have this in production with some partners, but they’re using our SDK. This implementation is still in test, but we’re launching the interface and Stripe payments in prod in the next week or so.

Would love to chat more! Feel free to email me (don@nevermined.io) or hit me up on our Discord (Nevermined).

Hi @fredzannarbor, thanks a ton for the breakdown of your comments and suggestions. We really appreciate the feedback.

We’d love to have you beta test the app. We will have the live Stripe integration towards the end of this week if everything goes according to schedule. Having your thoughts on what to improve would be awesome!

Recognizing you’ve already done a lot of work yourself, we should definitely share notes, and then hopefully we can help take the more complex implementations off your hands so that you can focus on building your app, as opposed to the mundane aspects of the backend. Also, we’re working on streamlining the steps, but your feedback would be invaluable here.

If you’d like, feel free to hit me up via email (don@nevermined.io) or on our Discord. Looking forward to chatting more!

1 Like

Hi @fredzannarbor,

I just wanted to drop an update to let you know that we know have the Stripe in production, so you can now get paid for real! Try it out here: https://nevermined.app/en. I’d love to extend a warm invitation to you to beta test the app and get your thoughts on what we can improve to make your experience special.

Chat soon!

5 Likes

agree! - interesting idea tho.

Is the integration with streamlit native?

1 Like

Thats lit

1 Like

Hi @JunWeiTech1997 - We agree, 21 steps is a lot to go through. We’re working on reducing the flow and would love your feedback on which steps could be combined or even removed. Please feel free to connect with me directly either on our Discord (Nevermined) or via email (don@nevermined.io).

very cool app and idea!

How did you make it in streamlit? It must have taken a lot of custom conponents

Hi there, this seems like a great product. Super keen to try it out, how do i get going, can I email you?

Thanks

Hi @cashbenties,

The Widget for payments was built just for Streamlit integration. It’s pretty straightforward, though could use improvement. The set up of the widget does indeed have a lot of custom components. This give a Streamlit builder a lot of flexibility in how they enable access to their Streamlit AI app.

Would love to chat more if you’d like.

Hi @Betsu,

We’d love to support you! Please feel free to DM me at my email: don@nevermined.io.

Chat soon!

A very cool idea, and much-needed. I am very interested, but can I use it for my own Streamlit apps that don’t use an API such as OpenAI?

Hi @mzeidhassan, thank you for the feedback. Yes, you could use it for any Streamlit app. Let’s discuss your use case further if it works for you. Feel free to ping me at my email (listed above) or jump into our Discord.

1 Like

Hello,
I would like to ask a question.

  • We are working on a streamlit app.
  • This streamlit app provides a specific chatbot environment with using Open AI ChatGPT API key.
  • We would like to integrate a payment/subscription model to our streamlit app.
  • From the all previous discussions, I understand that https://nevermined.app/ framework/solution can be used/integrated with streamlit seamlessly for this purpose.
1 Like

Hi @Necip_Gozuacik,

Thank you for reaching out. We’d love to assist you in integrating payments into your Streamlit based AI chatbot. Do you want to jump on a call? Maybe send me an email at don@nevermined.io and we can coordinate. I’m in the US this week, but will back in the EU on UK time next week. Maybe we can chat then?

Thanks,
Don

1 Like

Thanks @DGossen for your response. I will get in touch you when some items are also clarified on our side.

1 Like