Skip to content

feat(configuration): add support for extra request headers in llama.cpp server #57

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

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

Conversation

adfnekc
Copy link
Contributor

@adfnekc adfnekc commented May 6, 2025

Introduce a new configuration option extra_request_headers to allow sending additional headers to the llama.cpp server. This enhances flexibility for custom server configurations while ensuring it doesn't interfere with the OpenAI client model.

…pp server

Introduce a new configuration option `extra_request_headers` to allow sending additional headers to the llama.cpp server. This enhances flexibility for custom server configurations while ensuring it doesn't interfere with the OpenAI client model.
@adfnekc
Copy link
Contributor Author

adfnekc commented May 6, 2025

The reason for this change is that my llama.cpp server is set up on a private network, and to protect against external attacks, additional gateway validation has been added.

const headers = AxiosHeaders.from(this.extra_request_headers)
this.axiosRequestConfig = {
...this.axiosRequestConfig,
headers
Copy link
Collaborator

Choose a reason for hiding this comment

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

If there is an API key (this.api_key) in the headers it will be replaced. I would suggest to merge the new headers (extra_request_headers) with the existing ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right,I will fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants