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

Support for configurable URL prefix in llamafiler #604

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

vlasky
Copy link
Contributor

@vlasky vlasky commented Oct 28, 2024

Added support for new llamafiler commandline parameter --url-prefix or -u

This specifies a URL prefix (subdirectory) under which the llamafiler HTTP server will make the API accessible, e.g. /lamafiler.

Useful when running llamafiler behind a reverse proxy such as NGINX or Redbean.

By default, this is set to / (root).

Added support for new llamafiler commandline parameter --url-prefix or -u

This specifies a URL prefix (subdirectory) under which the llamafiler HTTP server will make the API accessible, e.g. /lamafiler.

Useful when running llamafiler behind a reverse proxy such as NGINX or Redbean.

By default, this is set to / (root).
@vlasky
Copy link
Contributor Author

vlasky commented Oct 28, 2024

This is a sequel to #597 which added configurable URL prefix support to the llamafile command.

I felt a bit perplexed by the existing llamafiler codebase, which seems to be a scattered mix of C and C++ code, so I implemented this in a manner that I considered understandable.

Wondering if the short form version of commandline parameter -u should be renamed as perhaps this could be mistaken for something else?

llamafile/flags.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@jart jart left a comment

Choose a reason for hiding this comment

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

LGTM

@jart jart merged commit 108191a into Mozilla-Ocho:main Oct 29, 2024
2 checks passed
jart added a commit that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants