llmgateway

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package llmgateway contains shared types for the LLM gateway feature, imported by both pkg/llm and pkg/client to avoid an import cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProxyOriginOf added in v0.27.0

func ProxyOriginOf(rawURL string) string

ProxyOriginOf returns rawURL with its path, query, fragment, and userinfo stripped so only the scheme and host remain (the "origin"). Tools like Gemini CLI that append their own API path (e.g. /v1beta/...) need the origin rather than the full proxy base URL to avoid doubled path segments.

Falls back to rawURL when:

  • parsing fails, or
  • the parsed URL has no Host (e.g. scheme-less "localhost:14000/v1" is parsed by url.Parse as Scheme=localhost, Opaque=14000/v1 with no Host), or
  • the parsed URL has a non-empty Opaque field (opaque URI reference).

Types

type ApplyConfig

type ApplyConfig struct {
	GatewayURL         string // direct-mode: URL of the upstream LLM gateway
	AnthropicBaseURL   string // direct-mode: effective ANTHROPIC_BASE_URL (gateway + optional path prefix)
	ProxyBaseURL       string // proxy-mode: URL of the localhost reverse proxy
	TokenHelperCommand string // direct-mode: shell command that prints a fresh token
	TLSSkipVerify      bool   // when true, instruct the tool to skip TLS verification
}

ApplyConfig holds the values needed to configure a single tool's LLM gateway settings. Using a struct prevents positional-argument mistakes when the caller has multiple similar string values in scope.

Jump to

Keyboard shortcuts

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