inference

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gateway

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

Gateway is an x402-enabled reverse proxy for LLM inference.

func NewGateway

func NewGateway(cfg GatewayConfig) (*Gateway, error)

NewGateway creates a new inference gateway with the given configuration.

func (*Gateway) Start

func (g *Gateway) Start() error

Start begins serving the gateway. Blocks until the server is shut down.

func (*Gateway) Stop

func (g *Gateway) Stop() error

Stop gracefully shuts down the gateway.

type GatewayConfig

type GatewayConfig struct {
	// ListenAddr is the address to listen on (e.g., ":8402").
	ListenAddr string

	// UpstreamURL is the upstream inference service URL (e.g., "http://localhost:11434").
	UpstreamURL string

	// WalletAddress is the USDC recipient address for payments.
	WalletAddress string

	// PricePerRequest is the USDC amount charged per inference request (e.g., "0.001").
	PricePerRequest string

	// Chain is the x402 chain configuration (e.g., x402.BaseMainnet).
	Chain x402.ChainConfig

	// FacilitatorURL is the x402 facilitator service URL.
	FacilitatorURL string
}

GatewayConfig holds configuration for the x402 inference gateway.

Jump to

Keyboard shortcuts

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