Skip to main content

Overview

The LLM API provides a unified interface for interacting with various language models. Strix uses LiteLLM under the hood to support multiple providers.

LLM Class

Main class for LLM interactions.

Constructor

LLMConfig
required
LLM configuration object
str | None
Name of the agent using this LLM
Example:

Properties

LLMConfig
LLM configuration
str | None
Associated agent name
str | None
Associated agent ID
str
Loaded system prompt

Methods

generate

Generates a streaming response from the LLM.
list[dict[str, Any]]
required
List of message dictionaries with “role” and “content” keys
AsyncIterator[LLMResponse]
Async iterator yielding LLMResponse objects
Example:

set_agent_identity

Sets the agent identity for telemetry.
str | None
Agent name
str | None
Agent ID

LLMConfig

Configuration for LLM behavior and model selection.

Constructor

str | None
Model identifier (defaults to STRIX_LLM environment variable)
bool
default:"True"
Enable prompt caching for supported providers (Anthropic)
list[str] | None
List of skill names to load for this configuration
int | None
Request timeout in seconds (defaults to 300)
str
default:"'deep'"
Scan mode: “quick”, “standard”, or “deep”
Example:

Properties

str
Model name as configured
str
Model name formatted for LiteLLM
str
Canonical model name for cost calculation
str | None
API key from environment or config
str | None
API base URL
bool
Whether prompt caching is enabled
list[str]
Loaded skills
int
Request timeout in seconds
str
Current scan mode

LLMResponse

Response from an LLM generation.
str
Generated text content
list[dict[str, Any]] | None
Parsed tool invocations from the response
list[dict[str, Any]] | None
Extended thinking blocks (for reasoning models like o1)
Example:

Supported Models

Strix Models

Hosted models with prefix strix/:

Anthropic

OpenAI

Custom Providers

Error Handling

LLMRequestFailedError

Raised when an LLM request fails.
str
required
Error message
str | None
Additional error details
Example:

Scan Modes

Scan modes affect the reasoning effort and system prompts:
Scan Mode
Fast scanning with medium reasoning effort. Best for quick assessments.
Scan Mode
Balanced scanning with high reasoning effort. Recommended for most use cases.
Scan Mode
Thorough scanning with high reasoning effort. Best for comprehensive security assessments.
Example:

Environment Variables

str
required
Model name (e.g., “claude-3-5-sonnet-20241022”, “gpt-4o”)
str
required
API key for the provider
str
default:"None"
Custom API base URL
str
default:"'300'"
Request timeout in seconds
str
default:"'high'"
Reasoning effort: “low”, “medium”, or “high”
str
default:"'5'"
Maximum retry attempts for failed requests

Full Example