llmproxy

package
v0.0.0-...-ec350aa Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LLMAllowPaths []string = []string{
	"/v1/messages",
	"/chat/completions",
	"/responses",
}

Functions

func InvokeLLMProxy

func InvokeLLMProxy(i *do.Injector)

func ProvideLLMProxy

func ProvideLLMProxy(i *do.Injector)

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(i *do.Injector) (*Handler, error)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(c *web.Context) error

type Option

type Option func(*Proxy)

func WithUsageRecorder

func WithUsageRecorder(recorder usageRecorder) Option

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(db *db.Client, logger *slog.Logger, opts ...Option) *Proxy

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UsageCapture

type UsageCapture struct {
	// contains filtered or unexported fields
}

func NewUsageCapture

func NewUsageCapture(logger *slog.Logger, src io.ReadCloser, ctx *UsageCaptureContext) *UsageCapture

func (*UsageCapture) Close

func (b *UsageCapture) Close() error

func (*UsageCapture) Read

func (b *UsageCapture) Read(p []byte) (int, error)

type UsageCaptureContext

type UsageCaptureContext struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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