unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Add plz-media-type and plz-event-source to GNU ELPA when stabilized
@ 2024-04-27  9:02 Roman Scherer
  2024-04-27 13:43 ` Philip Kaludercic
  0 siblings, 1 reply; 12+ messages in thread
From: Roman Scherer @ 2024-04-27  9:02 UTC (permalink / raw)
  To: emacs-devel; +Cc: ahyatt

[-- Attachment #1: Type: text/plain, Size: 3643 bytes --]


Hello Emacs Developers,

I am writing you to ask if we could include the ~plz-media-type~ [1]
and the ~plz-event-source~ [2] libraries to GNU ELPA, once Andrew
Hyatt and I declare them as releasable.

At the moment those 2 libraries are "vendored" (we copied 2 files) in
the llm [3] library. Andrew and I would like to ship them via the llm
library to users for now, and once we are confident there are no
serious issues we would like to release them to GNU ELPA. We plan to
do so in Q4 of 2024.

These libraries are designed to handle HTTP responses based on the
content type header and process the response in a way specific to the
media type. One example of this is to process a HTTP response in the
text/event-stream format (aka server sent events) and handle the
events as they arrive.

Both libraries use Adam Porter's plz library and I wrote them to
support Andrew Hyatt in his work on the llm library. We are planning
to add support to the llm library to make HTTP requests with
curl. This should solve reliability issues that Andrew saw, and allows
me to use the llm library with LLMs that sit behind the proxy of my
employer, who supported my work on this.

They also simplified the code in the llm library that handles the
various response formats that are in use by all those LLMs deployed
out there. The libraries are designed to be extendable and could be
used by Emacs packages that, as of today, implement their own way to
handle for example, server sent events in a streaming way.

*plz-media-type:*

This library builds upon the ~plz.el~ HTTP library and provides a
mechanism to process responses based on their content type headers. It
defines classes for parsing and processing the HTTP body of some
standard MIME types like JSON, XML, HTML. It also contains classes
that can handle formats like newline delimited JSON, or JSON arrays in
a streaming way. Those last formats are often used by LLMs. The
library is designed to be extendable (you can replace and bring your
own media type class) and frees users from writing their own process
filter functions.

*plz-event-source:*

This library provides a media type class, parser, and event source
implementation for the Server-Sent Events (SSE) protocol. The media
type class can be used with the ~plz-media-type~ library. We use it in
the llm library to process HTTP responses for LLMs that return a MIME
type of text/event-stream.

I won't spend any significant time on re-designing the API (we went
through many iterations) or making it compatible with url-retrieve
right now, in case someone is suggesting this. This project was partly
sponsored by my employer while I was on a 3 month working group and we
want to use the llm library with curl. My time on this is reaching an
end I would like to bring it over the finish line. I am committed to
support Andrew should any bugs or significant issues come up.

Andrew Hyatt asked me to write to you to get the green light for
publishing those libraries to GNU ELPA, once we think they are
stable. We plan to do this in about half a year.

If you agree on eventually releasing those libraries to GNU ELPA, we
plan to merge the "plz" branch of the llm library into master soon and
release it to a wider audience. One package that would immediately
benefit is Ellama [4] which I thoroughly tested while working on this.

My employer and I already did the copyright assignment paperwork,
which has been completed a month ago.

Wdyt?

Thanks, Roman.

[1] https://github.com/r0man/plz-media-type
[2] https://github.com/r0man/plz-event-source
[3] https://github.com/ahyatt/llm/tree/plz
[4] https://github.com/s-kostyaev/ellama

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-05-01 12:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-27  9:02 Add plz-media-type and plz-event-source to GNU ELPA when stabilized Roman Scherer
2024-04-27 13:43 ` Philip Kaludercic
2024-04-28 12:56   ` Roman Scherer
2024-04-29  6:09     ` Philip Kaludercic
2024-04-29  7:44       ` Roman Scherer
2024-04-29  7:46         ` Philip Kaludercic
2024-04-29  7:48           ` Roman Scherer
2024-04-29 18:24             ` Add plz-media-type and plz-event-source to GNU ELPA when stabilised Philip Kaludercic
2024-04-29 20:17               ` Roman Scherer
2024-05-01 11:25               ` Roman Scherer
2024-05-01 11:56                 ` Philip Kaludercic
2024-05-01 12:00                   ` Roman Scherer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).