-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include x-coding-assistant=aider header in litellm calls
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.
- Loading branch information
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters