Skip to content

feat: add GitHub Copilot CLI as LLM backend - #482

Open
gsoosk wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
gsoosk:feat-copilot-cli-llm-backend
Open

feat: add GitHub Copilot CLI as LLM backend#482
gsoosk wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
gsoosk:feat-copilot-cli-llm-backend

Conversation

@gsoosk

@gsoosk gsoosk commented Aug 10, 2026

Copy link
Copy Markdown

Adds a copilot_cli provider that drives the GitHub Copilot CLI (copilot -p) as a non-interactive LLM backend. Authentication comes from the CLI's own login session (or a COPILOT_GITHUB_TOKEN), so no API key is required, and any model exposed by a Copilot subscription can be used.

The CLI has no --system-prompt flag, so the system message is prepended to the prompt. reasoning_effort maps to --effort and is validated against the values the CLI accepts; max_ai_credits maps to --max-ai-credits. Generation runs with --silent --no-color --no-ask-user --no-custom-instructions --disable-builtin-mcps to keep stdout clean and prompts reproducible. Tools are not pre-approved by default since evolution only needs text generation; allow_all_tools opts in.

A non-zero exit is raised rather than warned about, because the CLI reports failures (such as an unavailable model) on stderr with an empty stdout, and a missing binary fails immediately instead of consuming the retry budget.

temperature, top_p and max_tokens have no CLI equivalent and are ignored by this backend.

Adds a quickstart example that reuses the function_minimization program and evaluator.

Adds a `copilot_cli` provider that drives the GitHub Copilot CLI
(`copilot -p`) as a non-interactive LLM backend. Authentication comes
from the CLI's own login session (or a `COPILOT_GITHUB_TOKEN`), so no API
key is required, and any model exposed by a Copilot subscription can be
used.

The CLI has no `--system-prompt` flag, so the system message is prepended
to the prompt. `reasoning_effort` maps to `--effort` and is validated
against the values the CLI accepts; `max_ai_credits` maps to
`--max-ai-credits`. Generation runs with `--silent --no-color
--no-ask-user --no-custom-instructions --disable-builtin-mcps` to keep
stdout clean and prompts reproducible. Tools are not pre-approved by
default since evolution only needs text generation; `allow_all_tools`
opts in.

A non-zero exit is raised rather than warned about, because the CLI
reports failures (such as an unavailable model) on stderr with an empty
stdout, and a missing binary fails immediately instead of consuming the
retry budget.

`temperature`, `top_p` and `max_tokens` have no CLI equivalent and are
ignored by this backend.

Adds a quickstart example that reuses the function_minimization program
and evaluator.
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