llmprovider

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package llmprovider constructs cogito LLM transports from nib configuration.

Native adapters (anthropic, google) self-register via llmprovider/registry in their init(). This file registers the OpenAI-compatible factory and provides the top-level New / NewWithStore constructors.

Adding a new native protocol: write the adapter package, call registry.Register in init(), and blank-import it below. No changes to NewWithTemperatureAndStore are needed.

Index

Constants

View Source
const (
	ProviderOpenAI = "openai"
	ProviderCodex  = "codex"
)

Variables

This section is empty.

Functions

func IsCodex

func IsCodex(config types.ModelProviderConfig) bool

func New

func New(config types.ModelProviderConfig) (cogito.LLM, error)

New returns an independent LLM transport. OpenAI means any OpenAI-compatible HTTP endpoint, including a local LocalAI server.

func NewWithStore added in v0.9.0

func NewWithStore(config types.ModelProviderConfig, store *auth.Store) (cogito.LLM, error)

NewWithStore is like New but resolves credentials from store for providers that support /login (anthropic, google, openai-direct).

func NewWithTemperature

func NewWithTemperature(config types.ModelProviderConfig, temperature float32) (cogito.LLM, error)

NewWithTemperature applies agent-specific sampling to OpenAI-compatible providers. Codex app-server owns its reasoning configuration and ignores the compatibility hint.

func NewWithTemperatureAndStore added in v0.9.0

func NewWithTemperatureAndStore(config types.ModelProviderConfig, temperature float32, store *auth.Store) (cogito.LLM, error)

NewWithTemperatureAndStore is the full constructor: temperature for OpenAI-compatible providers, credential store for providers with /login. A nil store is valid — the resolver falls through to config/env.

Codex is the only special case (it uses a subprocess, not HTTP). Every other provider goes through the registry: the provider Definition is looked up, and the registered adapter Factory for its Protocol is called.

Types

This section is empty.

Directories

Path Synopsis
Package anthropic adapts the Anthropic Messages API to cogito.LLM.
Package anthropic adapts the Anthropic Messages API to cogito.LLM.
Package azureresponses adapts the Azure OpenAI Responses API to cogito.LLM.
Package azureresponses adapts the Azure OpenAI Responses API to cogito.LLM.
Package bedrock adapts the Amazon Bedrock Converse Stream API to cogito.LLM.
Package bedrock adapts the Amazon Bedrock Converse Stream API to cogito.LLM.
Package codex adapts the OpenAI Codex Responses API (ChatGPT backend) to cogito.LLM.
Package codex adapts the OpenAI Codex Responses API (ChatGPT backend) to cogito.LLM.
Package copilot implements the GitHub Copilot multi-protocol adapter.
Package copilot implements the GitHub Copilot multi-protocol adapter.
Package geminicli adapts the Google Cloud Code Assist API (used by Gemini CLI) to cogito.LLM.
Package geminicli adapts the Google Cloud Code Assist API (used by Gemini CLI) to cogito.LLM.
Package google adapts the Google Generative AI API to cogito.LLM.
Package google adapts the Google Generative AI API to cogito.LLM.
Package googlevertex adapts the Google Vertex AI API to cogito.LLM.
Package googlevertex adapts the Google Vertex AI API to cogito.LLM.
Package ollama adapts the Ollama native chat API (/api/chat) to cogito.LLM.
Package ollama adapts the Ollama native chat API (/api/chat) to cogito.LLM.
Package openairesponses adapts the OpenAI Responses API to cogito.LLM.
Package openairesponses adapts the OpenAI Responses API to cogito.LLM.
Package registry maps wire protocols to adapter factories.
Package registry maps wire protocols to adapter factories.

Jump to

Keyboard shortcuts

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