HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Show HN: ChatAPI – PWA to Use ChatGPT by API(github.com)

32 points·by DavidHaerer·3 ปีที่แล้ว·4 comments
github.com
Show HN: ChatAPI – PWA to Use ChatGPT by API

https://github.com/david-haerer/chatapi

I've built this PWA to use ChatGPT by API.

My main motivation was to use the API since it is much cheaper than the premium plan and I only pay for usage. The main inspiration was ChatGPT-web by Niek [1], but I was lacking time to dig into the code base to make changes. Hence I went for a lightweight approach with Alpine.js and Open Props. There is no build step, the dependencies are fetched via CDN.

In general it was much fun to work with Alpine.js - being a parent means having very little time. So it was great to not have to invest 20h into learning a new framework. My main ask was something that gives me data binding and does not require a build step. Alpine.js was the perfect fit!

A hacky bit I'm proud of is the dynamic loading of languages for syntax highlighting with highlight.js :)

Feel free to fork, adapt and host for yourself!

4 comments

thejarren·3 ปีที่แล้ว
I use https://www.chatbotui.com/ all the time - not exactly the same approach you've taken, but is very useful.
SOLAR_FIELDS·3 ปีที่แล้ว
For something a little heavier but much more robust in terms of features/functionality I've been enjoying FastChat: https://github.com/lm-sys/FastChat

It allows you to plug in different backends so that you can use OpenAI compatible clients with various LLM's, selfhosted or otherwise.
brh7857·3 ปีที่แล้ว
I built a super-simple, 100% client-side chatgpt client because I wanted more control over what was sent to the API (system prompt, temperature, context window size etc): https://github.com/benrhughes/chat
Liutprand·3 ปีที่แล้ว
Similar concept but for the command line, with some more features: https://github.com/marcolardera/chatgpt-cli