Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

L402 for Local Development #31

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Kodylow
Copy link

@Kodylow Kodylow commented Sep 30, 2023

image

Allows a user to run modelfarm off of replit but only if they pay 1 satoshi in bitcoin per the L402 Payment Required protocol. Proving you paid the lightning invoice by setting the preimage in your .env file creates an L402 Authorization header that passes the Matador reverse proxy running on Replit.

The matador server (running in Replit) simply validates the L402, then swaps out the AUTHORIZATION header for its own "Bearer REPLIT_API_KEY" to complete the call to "https://production-modelfarm.replit.com"

Kind of janky and hardcoded to use my always on Repl (deployments don't work with nightly rust), but it's pretty cool haha.

Adds L402 via Matador reverse proxy to run modelfarm locally.
@Kodylow Kodylow marked this pull request as ready for review September 30, 2023 21:54
@Kodylow Kodylow changed the title Draft: L402 for Local Development L402 for Local Development Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant