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

Include x-coding-assistant=aider-version header in litellm calls #2988

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jhrozek
Copy link

@jhrozek jhrozek commented Jan 24, 2025

Proxies that inspect traffic between the development environment and an
LLM might be interested in whether it's aider or another tool calling in
order to be able to inspect and/or modify the payload.

The most common way of solving this would be to add a user-agent header.
However, litellm which aider uses calls into OpenAI libraries directly
when making the request and it seems like the only way to set a custom
http_client. This seemed like something that might have unforeseen
consequences (timeouts? retries?). For other LLMs, litellm seems to use
its own httpx wrapper which might presumably be easier to customize, but
I have not tried.

To make things easier, let's just add an aider specific header. I put
the version there, but the value - and indeed the key - of the header
are not that interesting, what I would like to do is to just be able to
to tell aider calls.

@jhrozek jhrozek changed the title Include x-aider-version header in litellm calls Include x-coding-assistant=aider-version header in litellm calls Jan 30, 2025
Proxies that inspect traffic between the development environment and an
LLM might be interested in whether it's aider or another tool calling in
order to be able to inspect and/or modify the payload.

The most common way of solving this would be to add a `user-agent` header.
However, litellm which aider uses calls into OpenAI libraries directly
when making the request and it seems like the only way to set a custom
`http_client`. This seemed like something that might have unforeseen
consequences (timeouts? retries?). For other LLMs, litellm seems to use
its own httpx wrapper which might presumably be easier to customize, but
I have not tried.

To make things easier, let's just add an aider specific header. I put the
string aider followed by the version there, but the value - and indeed the key
- of the header are not that interesting, what I would like to do is to just
be able to to tell aider calls.
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.

1 participant