config

package
v0.13.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Code generated from OpenAPI schema. DO NOT EDIT.

Index

Constants

View Source
const APPLICATION_NAME = "inference-gateway"
View Source
const VERSION = "v0.13.0-rc.1"

Variables

This section is empty.

Functions

func NewFileLookuperFromEnvFile

func NewFileLookuperFromEnvFile(path string) (envconfig.Lookuper, error)

NewFileLookuperFromEnvFile creates a new envconfig.Lookuper that reads from a file

Types

type A2AConfig added in v0.10.0

type A2AConfig struct {
	Enable          bool          `env:"ENABLE, default=false" description:"Enable A2A protocol support"`
	Expose          bool          `env:"EXPOSE, default=false" description:"Expose A2A agents list cards endpoint"`
	Agents          string        `env:"AGENTS" description:"Comma-separated list of A2A agent URLs"`
	ClientTimeout   time.Duration `env:"CLIENT_TIMEOUT, default=30s" description:"A2A client timeout"`
	PollingEnable   bool          `env:"POLLING_ENABLE, default=true" description:"Enable task status polling"`
	PollingInterval time.Duration `env:"POLLING_INTERVAL, default=1s" description:"Interval between polling requests"`
	PollingTimeout  time.Duration `env:"POLLING_TIMEOUT, default=30s" description:"Maximum time to wait for task completion"`
	MaxPollAttempts int           `env:"MAX_POLL_ATTEMPTS, default=30" description:"Maximum number of polling attempts"`
}

A2A configuration

type ClientConfig added in v0.7.0

type ClientConfig struct {
	Timeout               time.Duration `env:"TIMEOUT, default=30s" description:"Client timeout"`
	MaxIdleConns          int           `env:"MAX_IDLE_CONNS, default=20" description:"Maximum idle connections"`
	MaxIdleConnsPerHost   int           `env:"MAX_IDLE_CONNS_PER_HOST, default=20" description:"Maximum idle connections per host"`
	IdleConnTimeout       time.Duration `env:"IDLE_CONN_TIMEOUT, default=30s" description:"Idle connection timeout"`
	TlsMinVersion         string        `env:"TLS_MIN_VERSION, default=TLS12" description:"Minimum TLS version"`
	DisableCompression    bool          `env:"DISABLE_COMPRESSION, default=true" description:"Disable compression for faster streaming"`
	ResponseHeaderTimeout time.Duration `env:"RESPONSE_HEADER_TIMEOUT, default=10s" description:"Response header timeout"`
	ExpectContinueTimeout time.Duration `env:"EXPECT_CONTINUE_TIMEOUT, default=1s" description:"Expect continue timeout"`
}

Client configuration

type Config

type Config struct {
	// General settings
	Environment     string `env:"ENVIRONMENT, default=production" description:"The environment"`
	EnableTelemetry bool   `env:"ENABLE_TELEMETRY, default=false" description:"Enable telemetry"`
	EnableAuth      bool   `env:"ENABLE_AUTH, default=false" description:"Enable authentication"`
	AllowedModels   string `env:"ALLOWED_MODELS" description:"Comma-separated list of models to allow. If empty, all models will be available"`
	ConfigFilePath  string `env:"CONFIG_FILE_PATH, default=/app/.env" description:"Path to the configuration file"`
	// MCP settings
	MCP *MCPConfig `env:", prefix=MCP_" description:"MCP configuration"`
	// A2A settings
	A2A *A2AConfig `env:", prefix=A2A_" description:"A2A configuration"`
	// OIDC settings
	OIDC *OIDC `env:", prefix=OIDC_" description:"OIDC configuration"`
	// Server settings
	Server *ServerConfig `env:", prefix=SERVER_" description:"Server configuration"`
	// Client settings
	Client *ClientConfig `env:", prefix=CLIENT_" description:"Client configuration"`

	// Providers map
	Providers map[providers.Provider]*providers.Config
}

Config holds the configuration for the Inference Gateway

func Load

func Load(lookuper envconfig.Lookuper) (Config, error)

Load is a convenience way to call Config.Load with a default os lookuper.

func Reload

func Reload(logger logger.Logger, envFilePath string) (Config, error)

Reload reloads the configuration from environment variables and a given env file path

func (*Config) Load

func (cfg *Config) Load(lookuper envconfig.Lookuper) (Config, error)

Load configuration

func (*Config) String added in v0.5.0

func (cfg *Config) String() string

The string representation of Config

func (*Config) Validate

func (cfg *Config) Validate() error

TODO - move the logic of validation to this function and ensure this one is called - add it to the codgen after finalized

type FileLookuper

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

func (*FileLookuper) Lookup

func (f *FileLookuper) Lookup(key string) (string, bool)

Lookup retrieves the value for a given key from the file lookuper

type MCPConfig added in v0.7.0

type MCPConfig struct {
	Enable                bool          `env:"ENABLE, default=false" description:"Enable MCP"`
	Expose                bool          `env:"EXPOSE, default=false" description:"Expose MCP tools endpoint"`
	Servers               string        `env:"SERVERS" description:"List of MCP servers"`
	ClientTimeout         time.Duration `env:"CLIENT_TIMEOUT, default=5s" description:"MCP client HTTP timeout"`
	DialTimeout           time.Duration `env:"DIAL_TIMEOUT, default=3s" description:"MCP client dial timeout"`
	TlsHandshakeTimeout   time.Duration `env:"TLS_HANDSHAKE_TIMEOUT, default=3s" description:"MCP client TLS handshake timeout"`
	ResponseHeaderTimeout time.Duration `env:"RESPONSE_HEADER_TIMEOUT, default=3s" description:"MCP client response header timeout"`
	ExpectContinueTimeout time.Duration `env:"EXPECT_CONTINUE_TIMEOUT, default=1s" description:"MCP client expect continue timeout"`
	RequestTimeout        time.Duration `env:"REQUEST_TIMEOUT, default=5s" description:"MCP client request timeout for initialize and tool calls"`
}

MCP configuration

type OIDC added in v0.1.6

type OIDC struct {
	IssuerUrl    string `env:"ISSUER_URL, default=http://keycloak:8080/realms/inference-gateway-realm" description:"OIDC issuer URL"`
	ClientId     string `env:"CLIENT_ID, default=inference-gateway-client" type:"secret" description:"OIDC client ID"`
	ClientSecret string `env:"CLIENT_SECRET" type:"secret" description:"OIDC client secret"`
}

OIDC configuration

type ServerConfig added in v0.1.6

type ServerConfig struct {
	Host         string        `env:"HOST, default=0.0.0.0" description:"Server host"`
	Port         string        `env:"PORT, default=8080" description:"Server port"`
	ReadTimeout  time.Duration `env:"READ_TIMEOUT, default=30s" description:"Read timeout"`
	WriteTimeout time.Duration `env:"WRITE_TIMEOUT, default=30s" description:"Write timeout"`
	IdleTimeout  time.Duration `env:"IDLE_TIMEOUT, default=120s" description:"Idle timeout"`
	TlsCertPath  string        `env:"TLS_CERT_PATH" description:"TLS certificate path"`
	TlsKeyPath   string        `env:"TLS_KEY_PATH" description:"TLS key path"`
}

Server configuration

Jump to

Keyboard shortcuts

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