Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding linenoise.cpp to llama-run #11252

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ericcurtin
Copy link
Collaborator

This is a fork of linenoise that is C++17 compatible. I intend on adding it to llama-run so we can do things like traverse prompt history via the up and down arrows:

https://github.com/ericcurtin/linenoise.cpp

@ericcurtin
Copy link
Collaborator Author

Linked issue:

containers/ramalama#586

@rhatdan
Copy link

rhatdan commented Jan 15, 2025

This does not work on Windows? I guess inside of a container it would work.

@ericcurtin
Copy link
Collaborator Author

ericcurtin commented Jan 15, 2025

This does not work on Windows? I guess inside of a container it would work.

I couldn't find any library like linenoise that had Windows support. Plenty have macOS/Linux support. But yeah if using a container or WSL2, etc. we'd be fine.

I didn't kill Windows native support here, but you don't get the cool features like being able to cycle through prompt history with up and down arrows.

Comment on lines +22 to +25
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this will require adding a notice in the releases.

Copy link
Collaborator Author

@ericcurtin ericcurtin Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can I copy that in? I think the license is compatible once we include these copyrights

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this is usually handled, I guess we could add a file with all 3rd party copyright notices and copy it to the release packages.

Copy link
Collaborator Author

@ericcurtin ericcurtin Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same issue with CURL if we start distributing it for Windows FWIW, from curl license: "Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies."

@ggerganov you were speaking about shipping curl on Windows recently.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't know what is the common way to handle this. Probably look for how other projects do it.

Btw, each llama.cpp release already includes a copy of the full source code in this repo so I think all licenses are technically already included in the release packages? Again, we can make this more explicit if necessary - feel free to improve.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with that technique, there's no standard technique. Everybody does it a little different.

@ericcurtin ericcurtin force-pushed the linenoise.cpp branch 2 times, most recently from 27812c8 to 6360829 Compare January 15, 2025 20:52
@rhatdan
Copy link

rhatdan commented Jan 15, 2025

Most of the time windows will be using a container so this should not be an issue.

This is a fork of linenoise that is C++17 compatible. I intend on
adding it to llama-run so we can do things like traverse prompt
history via the up and down arrows:

https://github.com/ericcurtin/linenoise.cpp

Signed-off-by: Eric Curtin <[email protected]>
We get prompt history etc.

Signed-off-by: Eric Curtin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants