Help us shape the future of Go! Take the 2026 Go Developer Survey

modelsgateway

package
v1.111.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package modelsgateway discovers the models served by an OpenAI-compatible models gateway by querying its /v1/models endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListModels

func ListModels(ctx context.Context, gatewayURL string, env environment.Provider) ([]string, error)

ListModels queries <gatewayURL>/v1/models and returns the IDs of the models the gateway serves. Query parameters present in gatewayURL are forwarded. When the gateway targets a trusted Docker domain, the Docker Desktop token is required and sent as a Bearer token, mirroring how provider clients authenticate gateway traffic.

An error is returned when the gateway is unreachable, responds with a non-200 status (e.g. it doesn't implement /v1/models), or returns a body that isn't a valid OpenAI-style model list. Callers are expected to fall back to their non-discovery behavior in that case.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL