neurocore.llm.provider

LLM provider protocol and implementations.

Classes

LLMMessage

LLMResponse

LLMProvider

Protocol for LLM provider implementations.

AnthropicProvider

Anthropic Claude provider using the anthropic SDK.

OpenAIProvider

OpenAI provider using the openai SDK.

GeminiProvider

Google Gemini provider using the google-genai SDK.

MockProvider

Deterministic mock provider for testing. Never calls a real API.

LiteLLMProvider

Provider backed by LiteLLM, routing to 100+ model APIs.

Functions

build_provider(→ LLMProvider | None)

Build an LLMProvider from a config dict.

Module Contents

neurocore.llm.provider.build_provider(config: dict[str, Any]) LLMProvider | None[source]

Build an LLMProvider from a config dict.

Keys read:
llm_provider: provider name (required to build). One of

anthropic | openai | openai-compatible | ollama | vllm | litellm | gemini | mock.

llm_model: model identifier (optional, uses provider default) llm_api_key: API key (optional for mock/local gateways) llm_base_url: endpoint for openai-compatible/ollama/vllm/litellm

Returns None if llm_provider is not set.