Help us shape the future of Go! Take the 2026 Go Developer Survey

nativeagent

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package nativeagent runs bounded text-only roles through an isolated native Codex process backed by already-installed local Ollama weights. It does not use a user's Codex account, credentials, settings, hooks, or project files.

Index

Constants

View Source
const (

	// HarnessReserve is a conservative admission estimate for native instructions
	// and tool schemas, not an exact tokenizer count or a generation-time ceiling.
	HarnessReserve int64 = 16_384
)

Variables

This section is empty.

Functions

func DecodeEvents

func DecodeEvents(data []byte, model string) (inference.Response, error)

DecodeEvents validates one completed native text-only turn and its reported token usage without performing inference. It can also validate separately authorized Codex baseline receipts. It does not establish model identity, completeness of a captured stream, or the number of underlying HTTP calls.

Types

type Provider

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

Provider binds the local model snapshot and a particular native executable. Recreate it after changing weights or upgrading the native client.

func New

func New(ctx context.Context, executable, model string, timeout time.Duration) (*Provider, error)

New inspects local weights and the executable without performing inference. executable must be absolute; all process state is confined to a fresh private home and empty workspace. There is no remote endpoint or paid fallback option.

func (*Provider) CountInputTokens

func (p *Provider) CountInputTokens(ctx context.Context, req inference.Request) (int64, error)

CountInputTokens is a byte-based local estimate plus HarnessReserve, not a native tokenizer API. Native tool-turn totals are checked after generation by inference.Runner; the harness does not expose a hard output-token ceiling.

func (*Provider) Generate

func (p *Provider) Generate(ctx context.Context, req inference.Request) (inference.Response, error)

func (*Provider) Identity

func (p *Provider) Identity() string

func (*Provider) ModelDigest

func (p *Provider) ModelDigest() string

func (*Provider) RefreshIdentity

func (p *Provider) RefreshIdentity(ctx context.Context) error

RefreshIdentity prevents stale accepted results from bypassing a changed executable or changed local model snapshot. It never updates the pinned value.

func (*Provider) RuntimeVersion

func (p *Provider) RuntimeVersion() string

Jump to

Keyboard shortcuts

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