smileplease

Hosting a hobby project for free without credit card is tough (rant) & here's how I did it (Hugging face)

Tldr: I had tried a lot of services for just dead simple single python server deployment but the best one seems to be probably Hugging Face spaces. Here are what issues I had with some of them and a general opinion on the process and maybe what I liked about Hugging Face

Hello dear readers , I hope you're having a nice day.

backstory

I had recently come across this project github.com/nwtgck/piping-server and this seemed really cool. The reason why / how I stumbled upon this project was that I wanted to create a simpler https://sshx.io/ (since self hosting was hard) and I was just looking for alternatives in which I could rather use the terminal instead of the web browser whiteboard terminal of sshx

and you may ask why I did that ? simple , I was experimenting with jupyter notebooks and accessing their shell from my terminal , the most stable way I have till now found is emulating the whole archlinux system using junest and then installing tmux and then using ssh in tmate. This junest trick is really insane and I have found ways of port forwarding to a server using junest as well but I was looking for something non root so I decided to search similar terms on github / ddg till I found this project.

Now Just to say the least , I was impressed by piping-server and I felt like it could create something p2p-ish / a lot more weird ideas which were making chaotic sense in my mind. My mind was really loving the ideas of what I can do with piping-server (eerily similar to what I felt with https://justine.lol/ape.html , cosmopolitan)

So i decided to brain storm the most foundational Idea that I had and I decided to just do that. I really thought that hosting it would be the easier part

So I am going to be honest , I messed with claude enough to give me a boilerplate-ish / whole code which could be just useful enough and I was just thinking of pushing claude to its limits. (sometimes I found chatgpt to give better response , initially claude had stuck with the http streaming part , when I ran out of claude credits , I tried it on gpt and gpt worked on that which was kind of insane)

If you want to look at what I am talking about see this My-project (Yeah I have started to watch house , I usually name myself after whatever I am watching , its rather fun , I have named myself dwight shrute , jaime lannister and house xD on different coding platforms)

The idea is ephemeral piping where you can have it for special time like from 0 to 1 hour (though I have just self imposed this limit , you can have it for literally any time IIRC)

It stores it I think currently in its memory , though maybe storing it in the disc could also be the nice idea.

See the thing is , I am not confident in this project , I just want to use it casually for something useful that I might need someday. I am going to add things that I want to add , like webhooks / uploading that ephemeral data to some cloud provider. but at the same time , I want it to be public.

the present sucks ?? (You have to look a lot to find the best thing)

Now that I had my code , I just wanted to deploy it for free , no credit card (Firstly , I don't have credit card , secondly though I can ask my brother for his , I really don't want to take a chance of misconfigured aws causing him actual money)

if my project breaks some term and condition , fine , I would shut it down and have a private instance from a different account or coordinate with them , no problem . (But I really don't want to pay for a hobby project)

python python everywhere , but why is it so weird to host ?

I didn't want to use vercel , netlify because I see people shifting away from them because of their insane bandwidth costs. I wanted to challenge myself into different platforms I found many , the nwgtck piping servers itself were additionally hosted on glitch , runkit (other than the primary instance) and one more IIRC , but the problem was both of these were for node specific.

Deta.sh has recently shutdown but they were actually supporting python as well.

I tried Awesome-serverless , but here were the issues

Weblab : I tried it , and I think they were in beta and I think I registered from a temp mail and I was too impatient and forgot that mail. + it was for node only (actually I regreted writing it in python , but I generally write things in python or deno/node , I write things in node if its web dev / I am confident enough , otherwise I generally write it in python)

Webscript : I found this and I could've legit converted my project to lua , this seemed really interesting , the article said it was discontinued but the website is functional , so I thought hey lets sign up , so I decided to sign up , except it's really just stuck at accepting terms and condition (atleast this was my issue) / now at the time of writing this article , I checked it again and now its stuck at signup /login

Faastruby : I tried this since it mentioned crystal , and I just thought I am more than ready to port it in crystal except this website shows 502 Bad Gateway nginx

Tinyfunction : my python file was a single app.py generated by claude , so I thought I could have it here , except this is one of the most rare websites which actually provides a better ui to the people who've not signed in , then those who have signed in. I found that atleast when you aren't signed up , you could configure to have a random example working in their home page , except when you are signed up , it doesn't show that , and it shows a different interface and for god knows what reason. I don't know how you are supposed to access a running script / know if its running or not , the website is extremely beta-ic , (dare I say alpha) and felt like wasting my time. I was nowhere closer to hosting it.

then I tried Container-Hosting-another-web-service , I had used it in the past but this was also indeed shitty because I signed up and I tried a random django project in its home page , yet it didn't work , It just started creating repo in my github account yet didn't deploy , it showed me a 500 page but creates that repository IIRC.

I had also tried python anywhere but that just felt like a free moneygrab for their side , a lot of features were paylocked and the limitations on free tier makes you think vercel is generous with their bandwidth price IIRC.

my question to all of these above is , why do you not work ? why do you still bother a frontend space and give users a false hope that they can host here , why are these websites even displaying static website , just show 404 like faastruby atleast I was disappointed initially but I also didn't waste 2 hours why its creating a repo but not creating the whole app or if my ublock origin is messing up with that terms of service.

Then came Koyeb : It was everything what I had hoped for , I was on my last step on deploying the project except then it hit me with the most miserable move

Bot detection

Wtf , I had signed up using github and I would say that my github repo isn't like usual bots ? , so I decided to delete that organisation but oh you need to disable it first , so I tried disabling it , except oh , you can't do that if you are bot detected with no reasonable proof , okay nvm there is a appeal , so I gave them my hackernews address and wrote something along the lines of piping , they said 3 business days so I waited , except oh they rejected it (Wtf) and now I can't even re appeal. Wow they just banned me for no reason other than I was using python and docker / I came in the wrong system but I suppose that was why the appeal was for

I also don't understand why you can't escalate appeals / only single appeal system. also couldn't they have checked that I had oauth with my github , then why were they asking me for my github in appeal.

I had given up on the project , My exams had come and I decided to think after the exams

afterlogue : Hugging face comes in clutch.

Now I just searched it on reddit how to deploy python 24x7 or along this line , and I came across huggingface spaces.

(hey a little bit of story / sponsoring my brother freelance , I think its cool but again sry if it disturbed your reading experience here's a cookie for your trouble 🍪) My brother is a freelancer (https://www.poemsforaphrodite.tech/) (wow huh , I sponsored my brother , but holy cow , I hadn't seen his website till now and its insanely cool , He had said to me though that he wanted a terminal style website and asked me for my help , I gave him a library but I guess he found something cooler huh. ) (btw if you can , contact my brother , I don't run ads and you can't hire me and I don't even have a donation account , so you may hire my brother , because he's a good brother and I think I love him unconditionally.)

Okay so why was I talking about my brother again ? because he told me that he really likes Hugging Face because they were open source and Hugging face's model made the most sense for AI dev's which really made me respect Hugging Face as a company and a product much more which is harder these days when there are so many shitty providers.

But I had thought of Hugging Face as for deploying AI , but then I realised , that doesn't have to be that way.

They can allow hosting any html using docker / I think they even had a sdk and also their free tier is of two types : 1 simple cpu only and the other zerogpu ) (I picked the cpu one because my ephemeral piping instance doesn't need gpu )

There were also recommendations for mercury which can convert jupyter to web apps but Hugging Face has worked decently.

the thing with Hugging Face spaces is that unlike render etc. which shutdown after 10 mins of inactivity IIRC , Hugging Face sleeps after 2 days of inactivity ! (this is huge because I think I can use a simple cron to keep it open / use it myself for some stuff / experiment with it while creating this ephemeral piping logger )

I also believe that I have made my repo public so you can see all the code so you can see that I haven't created something sinister like a backdoor, you could also fork it rather easily and edit it without learning git right in browser (I also edited using browser because me being too lazy )

There is also ephemeral storage by default , (currently my ephemeral piping program stores it in its ram but if I can configure it to use disc then still ephemeral storage is a win in my book)

I was having some issues in default so I asked claude to write it again but instead prioritze on Hugging Face space , and it gave me gradio code which wasn't working , so I asked it to give me the html prior and it did and it worked and then I asked claude to reiterate to add more features because earlier it was a single instance where everybody had to talk through but not now. I was having some issue with docker so I asked it to write all code and it worked.

Now you may ask me why I wrote this thing in the first place , well my idea is that you can have a piping server in which one of these could be an ephemeral server like mine and then people can connect some logs or other things into that ephemeral server and I configure my ephemeral server to store that data to something like proton drive / pixeldrain while at the same time , this can also allow for ephemeral chats storing yet making it simple (a huge issue to me is that email isn't a viable option for private messaging and things like simplex / matrix etc. have tooo much information for ephemeral storage ,they are much better for all time storage) so having something like pping.io/chatheremate , and I just talk to them using curl and pping just really made me interesting.

I also think that by adding more features like people adding data to ephemeral storage and maybe increasing privacy aspect more. I can create some sort of better mechanism for hosting forum pages (IDK)

I don't know how to explain what I have in my mind , but I think its worth checking out. I am probably never going to make a single cent out of this. atleast that's the plan.

I was so pissed by my experience because I felt that this experience isn't of a single me but rather a huge populus who are using python . I was legit thinking of using something like flatpak and wrapping it to create my own single server provider for cool hobby projects but then I realised that flatpak isn't that good for cli apps . (I didn't think of container because I felt that on a single server , maybe I could experiment / hackaway with flatpak to create something like docker -ish but just for dead simple python deployments because why not?)

I was also thinking of snap but I don't like its proprietory nature and bubblewrap is too much robust and hard to deal with.

Honestly , I even discussed all these things to my mother and she just said I don't know what you are talking about but I just said to her , mom just listen , I just want to hear my frustration with things not working (till that time , I didn't try Hugging Face) She had actually then started asking me small questions like what's aws , okay why are they giving it for free and I really loved that conversation , it made my burden / resentment go away . (I love you mom , even though you are scolding me right now to go study instead of writing this article)

Yet I feel like sharing this story for no other sake than because I can and the fact that I really just want to convey how frustrating it can be to deploy a hobby project for others & yourself to enjoy upon. I had taken so much stress just because I felt like it was my responsibility to generate such tool because I see , quite frankly , a lot of exciting experiments that we can deal with such thing

I am more than interested to read the comments on hackernews / people guiding me on what I can do better in this project .


Thanks for reading