In case, you missed Part I and Part II, Arcadia was built out of my own need to expose ML models for API billing to other engineers/teams. In that sense, it’s the anti-HuggingFace. Get up-to-date with Parts I and II quickly below ↓
In order to allow other people access to proprietary ML/LLM models without giving them the models themselves, one must containerize the ML model and expose its external endpoint for API inference.
That’s why I created Arcadia — an end-to-end platform for uploading your ML models up for inference and charging for their API usage.
Watch the 1st Arcadia Demo. Sign up to the Waitlist here.
Throughout this 4-Part Series, I’m going to take you on a journey of experimentation, frustration, and ultimately creation of Arcadia — the platform for exposing your existing ML/LLMs to the world with zero downtime(free cost), and limitless ROI.
In Parts I & II, we went through: (Read below↓)
Part III is a part left undone and promised to you. We’re going to take from our notion of ModelUsage Counters and take a closer look at:
I spent an awful lot of time browsing through Stripe’s Docs in search of a component that would allow us 2-way routing of invoices. When I came across Stripe Connect and read:
Business models like marketplaces and software platforms use Connect and its related tools to route payments between businesses, customers, and recipients who need to get paid.
I knew I hit gold. That’s what we need.
We need our users to be able to deploy ML models and use them simultaneously.
Stripe Connect is a component that allows us to collect payments from customers and pay them out to sellers or service providers.
Here’s How Stripe Connect Works for Each User
2. We need to allow Stripe Connect Callback to store user access tokens. Once the user onboards to Stripe Connect, we will perform this backend endpoint:
Firstly, we learned in Part II that we can keep track of how many times a given user has called inference on a given ML model using a ModelUsage counter — a SQL lookup table that stores the increasing counter.
Secondly, knowing how much the deploying ML engineer wants to charge for the usage of one’s ML model, we calculate the ModelUsage counter with charge_per_api_call to arrive at user spenditure. Let’s bring that code up again.
The 3rd Step is to issue an invoice from the user to the deployer via Stripe invoicing. Here’s how we can accomplish this:
The 4th Step is for us as a platform to issue monthly invoices to every single user and deployer. This involves walking through the ModelUsage table and creating all the invoices.
This article is the promised peace on how to properly set up Stripe Connect for multi-routing invoicing. Now, everybody can use Arcadia with zero barrier-to-entry, connect to Stripe, and both use existing ML models in the Arcadia marketplace as well as deploy their own seamlessly. Yess!!!
That wraps up Part III. Finally, we learned how we can use Stripe Connect to enable users to both deploy and use ML models simultaneously. That’s proper work! Up next, is the “Putting It All Together” Part IV. Stay Tuned!
Join the Arcadia Waitlist ↓
If you’ve encountered similar challenges in deploying ML models to other companies/devs, you might consider applying your info to the waitlist below ↓