Documentation
¶
Index ¶
- func ApplyModelCapabilities(data map[string]interface{}, caps map[string]ModelCapability, ...) int
- func Handle(args []string) error
- func HandleUsages(args []string) error
- func ParseModelCapabilities(entries []string) (map[string]ModelCapability, error)
- func PatchCodexSSEOutput(body []byte) []byte
- func ReadCodexAuth(path string) (accessToken string, accountID string, err error)
- func StartAPIProxy(baseUrl string, modelMappings []string, port string, verbose bool, ...) error
- func StartCodexProxy(baseUrl string, modelMappings []string, port string, verbose bool, ...) error
- func TransformCodexRequest(data map[string]interface{}, logf func(format string, args ...any))
- type ColorMode
- type ModelCapability
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyModelCapabilities ¶ added in v0.0.10
func ApplyModelCapabilities(data map[string]interface{}, caps map[string]ModelCapability, logf func(format string, args ...any)) int
ApplyModelCapabilities delegates to the unexported applyModelCapabilities so the doctest harness can exercise image stripping on decoded request bodies.
func Handle ¶ added in v0.0.6
Handle dispatches a llm-proxy CLI invocation to the doc subcommand, the usage summary, the OpenAI/Codex proxies, or a generic --base-url proxy.
func HandleUsages ¶
func ParseModelCapabilities ¶ added in v0.0.10
func ParseModelCapabilities(entries []string) (map[string]ModelCapability, error)
ParseModelCapabilities delegates to the unexported parseModelCapabilities so the doctest harness can exercise --model-capability flag parsing.
func PatchCodexSSEOutput ¶ added in v0.0.6
PatchCodexSSEOutput delegates to the unexported patchCodexSSEOutput so the doctest harness can exercise SSE output-item injection.
func ReadCodexAuth ¶ added in v0.0.6
ReadCodexAuth delegates to the unexported readCodexAuth so the doctest harness can exercise auth.json parsing against temp files.
func StartAPIProxy ¶
func StartCodexProxy ¶
func StartCodexProxy(baseUrl string, modelMappings []string, port string, verbose bool, logFile string, modelCaps map[string]ModelCapability, colorEnabled bool) error
StartCodexProxy starts a Codex OAuth proxy with the default stream behavior.
func TransformCodexRequest ¶ added in v0.0.6
TransformCodexRequest delegates to the unexported transformCodexRequest so the doctest harness can exercise system-message -> instructions adaptation.
Types ¶
type ColorMode ¶ added in v0.0.12
type ColorMode int
ColorMode selects when ANSI color is emitted, per the three-mode policy (auto / always / never). See go-best-practice cli/color.
type ModelCapability ¶ added in v0.0.10
type ModelCapability uint
ModelCapability is a bitmask of per-model capability limits declared via --model-capability MODEL=opt1,opt2.
const ( // CapNoImage marks a model that rejects image input upstream (e.g. a // text-only gateway endpoint answers 404). Image content parts are // replaced with a text note before the request leaves the proxy. CapNoImage ModelCapability = 1 << iota )