Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

Using the Umbrella Crate

The fastest way to get started is the neuron umbrella crate with feature flags:

[dependencies]
neuron = { features = ["anthropic"] }

Or install via cargo:

cargo add neuron --features anthropic

Feature Flags

FeatureEnablesDefault
anthropicneuron-provider-anthropicYes
openaineuron-provider-openaiNo
ollamaneuron-provider-ollamaNo
mcpneuron-mcp (Model Context Protocol)No
runtimeneuron-runtime (sessions, guardrails)No
otelneuron-otel (OpenTelemetry instrumentation)No
fullAll of the aboveNo

Using Individual Crates

Each neuron crate is independently published. Use them directly for finer control over dependencies:

[dependencies]
neuron-types = "*"
neuron-provider-openai = "*"
neuron-tool = "*"
neuron-loop = "*"

This pulls in only what you need — no transitive dependency on providers you don’t use.

Minimum Supported Rust Version

neuron requires Rust 1.90+ (edition 2024). It uses native async traits (RPITIT) and requires no #[async_trait] macro.

Environment Variables

Each provider loads credentials from environment variables via from_env():

ProviderEnvironment Variable
AnthropicANTHROPIC_API_KEY
OpenAIOPENAI_API_KEY
OllamaOLLAMA_HOST (default: http://localhost:11434)