Build Your Own ChatGPT with Ruby on Rails 7 and OpenAI API
Vložit
- čas přidán 28. 09. 2023
- 👋 Hey there, tech enthusiasts! In today's tutorial, I'll walk you through creating your very own ChatGPT clone using Ruby on Rails 7.
Follow along on Substack 👇
seankeever.substack.com/p/min...
🛠 Tech Stack:
- Ruby on Rails 7
- OpenAI
- Stimulus
🎯 Key Takeaways:
- How to set up a new Rails app with necessary dependencies.
- Adding chat functionality via OpenAI API.
- Making the UI interactive with Stimulus.
📦 GitHub Repo:
github.com/swkeever/mini-chatgpt
📚 Resources:
Rails Documentation: guides.rubyonrails.org/
OpenAI API Docs: platform.openai.com/docs/api-...
Stimulus Reference: stimulus.hotwired.dev/referen...
👤 About Me:
I'm Sean Keever, a professional software engineer with a knack for breaking down complex topics into easily digestible pieces. Feel free to connect with me!
If you found this tutorial useful, don't forget to hit the 👍 button and subscribe for more tech tutorials!
#rubyonrails - Věda a technologie
Love your code approach and your video. In 5 minutes. Hats off.
Thank you! I appreciate the comment
Thanks for keeping this short and sweet!
Glad you liked it!
Great content ;)
Awesome video.
Thanks for watching!
Super helpful. Thanks so much. Any updates to this, or ideas of how you would do it differently/better today?
Thanks for the feedback! Whether I would do something different depends on the requirements of the app, but using SSE is still a viable option and probably what I’d look to first.
Amazing!! You know how to make this but with your own data, pdf?
I can't find any info
I would take a look at fine tuning: platform.openai.com/docs/guides/fine-tuning
This does not scale beyond the web workers does it? So basically serve something like 8 users in parallel and then timeout for everyone else, right?
That’s a great question. Thanks! I confess I haven’t stress tested the tutorial implementation. However, OpenAI itself utilizes SSE to power the ChatGPT API to millions of users. So I don’t think it would be limited to a low number like 8, but it would probably depend on how much memory your server has.
Considering that this will hold the server until the whole response is rendered how well do you think it will scale. For example if 10 users make a request using this approach will the server start to struggle. Sorry if the question is stupid
SSE can handle multiple concurrent connections using a single HTTP connection for each client. While each connection does use server resources, modern servers, especially those running asynchronous technologies, can manage many connections at once. For handling more users, techniques like load balancing and horizontal scaling can improve scalability.
Hi Sean
This video is dope!
Is there a way to contact you for Ruby on Rails mentoring/coaching?
Appreciate the feedback Matt! I don’t have bandwidth for coaching right now but I’m curious what topics are you interested in learning about?