llm icon indicating copy to clipboard operation
llm copied to clipboard

Librarification

Open philpax opened this issue 2 years ago • 4 comments

This is a very rough split of the CLI application into a library and application. It includes #8 because that was on my branch when I did this - we can figure out what to do with it when it's time.

The main differences are

  • conversion of printlns to logs
  • removal of prints
  • adding a callback function for arrival of new tokens

Turns out this is basically entirely sufficient for first-pass use as a library. Here's proof.

philpax avatar Mar 15 '23 00:03 philpax

Amazing work on llamacord btw! :smile: I'm gonna try this out

setzer22 avatar Mar 15 '23 09:03 setzer22

Thanks for the feedback, everyone! Will action within the next few hours so we can get this merged 👍

philpax avatar Mar 15 '23 20:03 philpax

The llama-rs crate now has no logging of its own; all progress is reported through the callback. Pretty happy with how that turned out!

I've also switched over to thiserror. I've tried to remain consistent with the existing names, but I'd like to agree on #17 before we have any major users.

As an aside: should the CLI be llama-cli or llama-rs-cli?

philpax avatar Mar 16 '23 01:03 philpax

As an aside: should the CLI be llama-cli or llama-rs-cli

I was originally thinking llama-rs-cli. But after seeing the name, I really like llama-cli, especially if it ends up in someone's path via cargo install, it's easier to type. So if you prefer that one I'm on board as well!

setzer22 avatar Mar 16 '23 08:03 setzer22