kasvith
Hi,
We are trying to develop a LLM chat agent. So far lot of libraries have been written in JS or Python. But Elixir provides an excellent WebSocket support
So we decided to use Elixir Phoenix Sockets to stream responses from LLMs for Chats
Has anyone done this? what are the libraries you used? Any drawbacks on this approach?
Will SSE would be a better option than phoenix sockets?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
ndrean
Did you check this article from Sean Moriarity? https://www.hackwithgpt.com/blog/streaming-chatgpt-responses-with-phoenix-liveview/
kasvith
i saw, but this is not about LV
the main problem i saw was all the manual work he had to do to get streaming response from the LLM. For example if we want to switch to Gemini at some point or a custom model have to repeat same kind of code again
i was evaluating whether it worth the trouble
gmile
@kasvith what was a approach / solution have you settled on at the end of the day?
ruslandoga
I did something like this in GitHub - ruslandoga/wat · GitHub
Relevant bits:
stream_answerfunctionavi-turetsky
This has definitely been a pain point for us as well. I know it’s asking for a lot but an equivalent of something like AI SDK by Vercel for elixir would be huge. It’s one of the few times where we’ve really been bit by the smaller ecosystem of elixir. Most of the time you can just write it yourself but as @kasvith mentioned its a lot of manual work to implement streaming for each provider.
kasvith
Hey guys, we moved on with Vercel AI SDK with SSE
chrismccord
Req to chat completions with
:intoand process send and no other libs required. OpenAI compatible endpoints gives you plug and play with many LLMs, including google’s. You can see langchain here for higher level building blocks and integrations, but it’s shockingly easy to get streaming tokens out to a client wether LiveView or js channels client.gtcode
Thanks, Chris. This is fantastic timing because I am researching approaches for building a generalized streaming client in Elixir.
Initial plan was to use a genserver or a supervised Task, then saw your post.
May I ask if you (or anyone) could read this and comment? Rube Goldberg, or good idea?
gtcode
I’m working on gemini_ex, which will be a comprehensive adapter for Gemini both using Gemini keys and Vertex auth strategies:
https://github.com/nshkrdotcom/gemini_ex/
Today, I added streaming using SSE and a genserver:
https://github.com/nshkrdotcom/gemini_ex/blob/main/STREAMING_ARCHITECTURE.md
Colors for the mermaid diagram were chosen to be in the Elixir style. The implementation is still very much in alpha/unstable phase.
Open to feedback.