Skip to main content

Cloud Platforms

GitHub Models

Call models from the GitHub Models catalog through your Verdictan gateway. Your GitHub token stays on the gateway, and your application calls the gateway with its application token.

This page is about GitHub Models as a model provider. To send GitHub Copilot traffic through Verdictan, see VS Code and GitHub Copilot.

Before you start​

  • A working gateway from the quickstart.
  • A GitHub token with GitHub Models access, and one model ID from the GitHub Models catalog.
  • The gateway startup command, and a separate application token for test requests.

Configure the provider​

Set base_url to https://models.github.ai, without /inference. The gateway adds that segment itself.

policy-config.yaml
pack:
  name: github-models-integration
  version: 1.0.0
  enabled: true
policies:
  chain:
    - prompt-injection
providers:
  targets:
    - id: github-models-primary
      provider: github
      model: "replace-with-github-models-model-id"
      base_url: https://models.github.ai
      secret_key_ref:
        env: VERDICTAN_GITHUB_API_KEY

The gateway sends Chat Completions to /inference/chat/completions with the token from VERDICTAN_GITHUB_API_KEY as a Bearer token. It also adds the Accept: application/vnd.github+json and X-GitHub-Api-Version headers that GitHub requires.

Start and verify​

To deploy from your terminal, use CLI 0.1.14 or later. The CLI uses your Verdictan account credential. Keep the GitHub token on the gateway, then check In sync.

With the quickstart in Docker, follow the container steps instead of steps 1 to 3.

  1. In the gateway terminal, set the token and lint the file:

    export VERDICTAN_GITHUB_API_KEY="<github-token>"
    verdictan policy lint --file policy-config.yaml
  2. Restart the test gateway with the GitHub token in its environment.

  3. Deploy the file to the test agent in Configurations. If that agent already runs pack.version 1.0.0, increase the version first. Then wait for the gateway log line connected read model refresh applied updated config with your version as config_version. Try the change on a test gateway has the steps.

  4. In a second terminal, send a request for the configured model:

    export VERDICTAN_CLIENT_TOKEN="<application-token>"
    curl --fail-with-body http://127.0.0.1:41002/v1/chat/completions \
      -H "Authorization: Bearer ${VERDICTAN_CLIENT_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"model":"replace-with-github-models-model-id","messages":[{"role":"user","content":"Reply with Hello."}]}'

choices[0].message.content contains the reply, and the request appears in History when capture is on, or in the delivered events.

Supported requests​

RequestSupport
Chat CompletionsYes. Streaming, tools, and response_format work if the model supports them.
MessagesTranslated to Chat Completions
ResponsesThe adapter builds a Responses path, but it is not tested against GitHub Models. Use Chat Completions.
Embeddings, image inputNo

Failure behavior​

ProblemWhat to check
401 from the gatewayThe application token is active, and the GitHub token is set on the gateway host.
Provider authentication errorVERDICTAN_GITHUB_API_KEY is set and has GitHub Models access.
404 from GitHubbase_url is https://models.github.ai, with no /inference segment.
Model not foundThe model ID is from the GitHub Models catalog and matches the target.
Provider 429 or another upstream errorThe response body and your GitHub Models rate limits. See Error Handling.

Limits​

  • Model names, rate limits, and data terms are in the GitHub Models documentation.
  • The gateway sends X-GitHub-Api-Version: 2026-03-10 by default. To send a different version, set VERDICTAN_GITHUB_MODELS_API_VERSION in the gateway environment.
  • A listener on a non-loopback address needs TLS and network controls.

Next steps​