Github Copilot Provider
What feature would you like to see?
It would be nice to have Github copilot as a model provider. Copilot offers an endpoint that is OpenAI compatible but requires Github authentication and token refreshing.
Are you interested in implementing this feature?
No response
Additional information
I think it was available in the non-rust version but has not been ported yet
I would be open to help implementing this.
A rough plan could be:
- Add a new
copilotprovider that can be enabled via configuration. - Implement the authentication flow to read the local GitHub token and exchange it for a temporary API token.
- Create a client adapter for the Copilot Chat API endpoint.
- Add a simple way in the TUI to manage sign-in and see the current status.
For the auth and client logic, I'd plan to take inspiration from Zed's implementation, which seems quite solid: https://github.com/zed-industries/zed/tree/main/crates/copilot/src
Does this seem like a reasonable approach?
Seems good. Would be great to have model selector working seamlessly with copilots model unless it brings about serious complexity at which point setting model via cli flag might be simpler
Hello @pakrym-oai,
I've implemented the GitHub Copilot provider as outlined in my previous comment.
Could I get approval from an OpenAI team member to open a PR? I want to make sure this aligns with the project roadmap before submitting.
Thanks
Hello @pakrym-oai,
I've implemented the GitHub Copilot provider as outlined in my previous comment.
Could I get approval from an OpenAI team member to open a PR? I want to make sure this aligns with the project roadmap before submitting.
Thanks
@benjosua Do you have a branch somewhere so community could test?