systemone

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package systemone implements inference.Provider over the "typed decision" wire protocol: POST {base}/systemone with a shared state and a named typed question, answered with a probability distribution rather than generated text.

One Provider covers every server that speaks it: TypeSafe's hosted Jev (directly, or fronted by the Vercel AI Gateway), and self-hosted logit-scoring servers such as simple-jev, which serve the same shape over any open model. Only the "choice" question type is implemented — the generic inference.Request/Response shape has no use for the noul or score question types the wire protocol also supports.

Index

Constants

View Source
const DefaultModel = "jev-latest"

DefaultModel is TypeSafe's rolling Jev model alias, used when Config.Model is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BaseURL is the systemone server root (e.g.
	// https://api.typesafe.ai/v1, or a Vercel AI Gateway / self-hosted
	// simple-jev root). Required.
	BaseURL string
	// APIKey authenticates via "Authorization: Bearer <key>". May be empty
	// for a keyless self-hosted server (see register.go's loopback rule).
	APIKey string
	// Model overrides DefaultModel.
	Model string
	// Timeout bounds a single HTTP call. Ignored when HTTPClient is set.
	Timeout time.Duration
	// HTTPClient lets the caller provide a custom transport (test
	// httptest server, timeouts). Default is a Timeout-bounded client.
	HTTPClient *http.Client
}

Config configures a Provider.

type Provider

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

Provider answers inference.Request calls against the typed-decision wire protocol.

func New

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

New builds a Provider from cfg. BaseURL is required.

func (*Provider) ApplyHTTPTuning added in v2.12.0

func (p *Provider) ApplyHTTPTuning(t base.HTTPTuning) error

ApplyHTTPTuning replaces the provider's HTTP client with a tuned copy, implementing base.HTTPTunable so a provider file's headers, request_timeout and http_transport reach this backend.

func (*Provider) Infer

Infer asks a single choice question — Request.Labels as the candidate answers, Request.Prompt as the instructions, Request.Inputs as the shared state — and returns the winning answer's probability distribution as Scores, highest first.

Jump to

Keyboard shortcuts

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