local

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey               string
	Model                string
	BaseURL              string
	EndpointURL          string
	HTTPClient           *http.Client
	Mode                 Mode
	OpenAICompatEndpoint OpenAIEndpoint
	AnthropicAPIVersion  string
	AnthropicMaxTokens   int
	Retry                gaugo.RetryConfig
	MaxResponseBody      int64
}

Config configures a local model service judge.

func (Config) Validate

func (cfg Config) Validate() error

Validate reports invalid local provider configuration.

type Judge

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

Judge evaluates metric prompts with a local model service.

func New

func New(cfg Config) (*Judge, error)

New returns a configured local judge.

func (*Judge) EvaluateJSON

func (j *Judge) EvaluateJSON(ctx context.Context, req gaugo.JudgeRequest) (gaugo.JudgeResponse, error)

EvaluateJSON evaluates one structured metric request.

type Mode

type Mode string

Mode selects the local model service wire protocol.

const (
	// ModeNative uses Ollama's native /api/chat endpoint.
	ModeNative Mode = "native"
	// ModeOpenAI uses OpenAI-compatible local endpoints.
	ModeOpenAI Mode = provider.OpenAI
	// ModeAnthropic uses an Anthropic-compatible local endpoint.
	ModeAnthropic Mode = provider.Anthropic
)

type OpenAIEndpoint

type OpenAIEndpoint string

OpenAIEndpoint selects the OpenAI-compatible local endpoint.

const (
	// OpenAIEndpointChat uses /v1/chat/completions.
	OpenAIEndpointChat OpenAIEndpoint = "chat_completions"
	// OpenAIEndpointResponses uses /v1/responses.
	OpenAIEndpointResponses OpenAIEndpoint = provider.ResponsesWireName
)

Jump to

Keyboard shortcuts

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