Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruby_llm-github_copilot

GitHub Copilot provider for RubyLLM.

Uses the undocumented OpenAI-compatible Copilot API with OAuth Device Code Flow authentication. No API key needed -- just authorize with your GitHub account.

Installation

gem 'ruby_llm-github_copilot'

Usage

require 'ruby_llm-github_copilot'

chat = RubyLLM.chat(model: 'gpt-4o', provider: :github_copilot)
response = chat.ask("Hello!")
puts response.content

On first use, you'll be prompted to visit a URL and enter a code to authorize. Tokens are cached to ~/.config/ruby_llm/github_copilot/ so you only need to do this once.

Configuration

RubyLLM.configure do |config|
  # Override the default token cache directory
  config.github_copilot_token_dir = '/path/to/tokens'
end

Streaming

chat.ask("Tell me a story") { |chunk| print chunk.content }

Available Models

The provider includes ~30 models: GPT-3.5, GPT-4, GPT-4o, GPT-4.1, GPT-5, Claude (Haiku, Sonnet, Opus), Gemini, and embedding models. All pricing is zero (included in your Copilot subscription).

Requirements

  • Ruby >= 3.1.3
  • ruby_llm ~> 1.14
  • A GitHub account with Copilot access

License

MIT

About

A Github Copilot provider for RubyLLM

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages