npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blauerberg/copilot-local

v0.1.0

Published

Wrapper for GitHub Copilot CLI to use local LLMs

Downloads

13

Readme

copilot-local

A wrapper CLI for GitHub Copilot CLI that makes it easy to use local LLMs. It reads environment variables from a config file and launches the copilot command with them set.

Motivation

Claude Code supports loading environment variables from a JSON config file, which makes it easy to redirect API calls to any local LLM. GitHub Copilot CLI has no equivalent feature, so switching the API endpoint requires manually setting environment variables each time. This small wrapper brings the same convenience to Copilot CLI.

Requirements

  • Node.js 22+
  • GitHub Copilot CLI

Installation

npm install -g @blauerberg/copilot-local
# or run on demand with npx
npx @blauerberg/copilot-local <model>

Configuration

Generate a config file automatically

If your LLM server exposes an OpenAI-compatible /v1/models endpoint (llama.cpp, LM Studio, Ollama 0.1.24+, etc.), you can generate a config template automatically:

copilot-local generate-config --models-endpoint http://localhost:11434/v1/models \
  > ~/.config/copilot-local/settings.json

This fetches the model list from the endpoint and writes a template with all required environment variables pre-filled. Open the file and replace <YOUR_API_KEY> with the actual API key (or any non-empty string if the server doesn't require one).

Manual setup

Alternatively, create ~/.config/copilot-local/settings.json manually and define one or more local models:

{
  "gpt-oss-20b": {
    "COPILOT_PROVIDER_BASE_URL": "http://localhost:11434/v1",
    "COPILOT_PROVIDER_API_KEY": "dummy",
    "COPILOT_PROVIDER_TYPE": "openai",
    "COPILOT_MODEL": "gpt-oss-20b",
    "COPILOT_PROVIDER_MAX_PROMPT_TOKENS": 32000,
    "COPILOT_PROVIDER_MAX_OUTPUT_TOKENS": 64000,
    "COPILOT_OFFLINE": true
  }
}

Each key-value pair is exported as an environment variable before copilot is invoked. Run copilot help providers for details on available environment variables.

Usage

Run with a model

copilot-local <MODEL> [--config FILE] [-- copilot args]

| Argument | Description | | --------------- | -------------------------------------------------------------------------- | | MODEL | Profile name defined in the config file (required) | | --config FILE | Path to the config file (default: ~/.config/copilot-local/settings.json) | | args after -- | Passed through directly to copilot |

If no arguments are passed after the model name, copilot -i "" is launched in interactive mode.

# Interactive mode
copilot-local gpt-oss-20b

# Pass arguments to copilot
copilot-local gpt-oss-20b -- version

# Use a custom config file
copilot-local gpt-oss-20b --config ~/my-settings.json

Generate a config template

copilot-local generate-config --models-endpoint <URL>

| Option | Description | | --- | --- | | --models-endpoint <URL> | OpenAI-compatible /v1/models endpoint (required) |

Prints a JSON config template to stdout. Redirect to a file to save it:

copilot-local generate-config --models-endpoint http://localhost:11434/v1/models \
  > ~/.config/copilot-local/settings.json

Shell Completion

Tab completion for model names can be enabled with the completions command.

zsh — add to ~/.zshrc:

eval "$(copilot-local completions zsh)"

bash — add to ~/.bashrc:

eval "$(copilot-local completions bash)"

After reloading your shell, pressing <Tab> after copilot-local will show the model names defined in your config file as candidates.

Troubleshooting

Error: 'copilot' command not found GitHub Copilot CLI is not installed or not in your PATH. Follow the installation guide and make sure copilot is available in your shell.

Error: config file not found The config file does not exist at the default path (~/.config/copilot-local/settings.json). Create the file as shown in the Configuration section, or pass a custom path with --config.

Error: '<model>' not found The model name you passed does not exist in the config file. The error message lists the available model names.

See also