Skip to content

feat(adapters): uses user-defined headers on get_model() call for openai_compatible adapters#2722

Merged
olimorris merged 1 commit intoolimorris:mainfrom
pvskp:main
Feb 5, 2026
Merged

feat(adapters): uses user-defined headers on get_model() call for openai_compatible adapters#2722
olimorris merged 1 commit intoolimorris:mainfrom
pvskp:main

Conversation

@pvskp
Copy link
Contributor

@pvskp pvskp commented Feb 5, 2026

Description

This allows the usage of custom headers on the get_models() call in the openai_compatible adapter. The current way is kinda hardcoded and some companies uses custom headers to control access on their AI Gateway.

AI Usage

I used to review my changes and to check it there was a better way to implement this. I used Claude Haiku 4.5.

Related Issue(s)

Screenshots

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I confirm that this PR has been majority created by me, and not AI (unless stated in the "AI Usage" section above)
  • I've run make all to ensure docs are generated, tests pass and StyLua has formatted the code
  • (optional) I've added test coverage for this fix/feature
  • (optional) I've updated the README and/or relevant docs pages

@pvskp
Copy link
Contributor Author

pvskp commented Feb 5, 2026

I'm sorry, I just saw the note on the beginning of the file. Even tho it's not supported, I see this as a good addition since this is useful to not having to recreate this from scratch (and it seems more accurate than extending the default openai adapter, mainly because of the get_models function) .

@olimorris
Copy link
Owner

I'm sorry, I just saw the note on the beginning of the file. Even tho it's not supported, I see this as a good addition

No problem. I put the disclaimer there because it became a really challenging adapter for me to support as so many endpoints claim "OpenAI compatibility" yet have subtle differences. This is indeed a great addition

@olimorris olimorris merged commit 3062e0b into olimorris:main Feb 5, 2026
8 checks passed
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