🎉 ai-infra v1.0 is here — Production-ready AI/LLM infrastructure
What's new
nfrax logonfrax

Infrastructure that just works. Ship products, not boilerplate.

Frameworks

  • svc-infra
  • ai-infra
  • fin-infra
  • robo-infra

Resources

  • Getting Started
  • What's New
  • Contributing

Community

  • GitHub

© 2026 nfrax. All rights reserved.

nfrax logonfrax
Start HereWhat's New
GitHub
ai-infra

API Reference

Auto-generated API documentation from Python docstrings. Browse classes by category or search for specific functionality.

34 classes•257 methods•55 async•9 categories

Core

5
replay
class
MemoryStorage
5
()
In-memory storage backend
tools
class
ProgressStream
1 async1
(tool_name: str, callback: Callable[[ProgressEvent], Any] | None)
Stream for sending progress updates from tools
replay
class
SQLiteStorage
6
(db_path: str | Path)
SQLite-based storage backend
tracing
class
TracingCallbacks
9
(tracer: Tracer | None)
Callbacks that create spans for ai-infra operations
replay
class
WorkflowRecorder
7
(record_id: str, storage: Storage | None)
Records agent workflow steps for later replay

LLM

9
llm
class
Agent
7 async13
(tools: list[Any] | None, provider: str | None, model_name: str | None, ...)
Agent-oriented interface (tool calling, streaming updates, fallbacks)
llm
class
AudioOutput
1
(voice: str, format: str)
Configuration for audio output from LLMs
llm
class
LLM
2 async8
(callbacks: Callbacks | (CallbackManager | None))
Direct model convenience interface (no agent graph)
llm.memory
class
MemoryStore
13
(backend: str, embedding_provider: str | None, embedding_model: str | None, ...)
Long-term memory store with semantic search
llm.personas
class
Persona
4
(name: str, prompt: str, tools: list[str] | None, ...)
Agent persona configuration
llm
class
RealtimeVoice
2 async10
(provider: str | BaseRealtimeProvider | None, config: RealtimeConfig | None)
High-level facade for real-time voice conversations
llm
class
STT
1 async6
(provider: str | None, model: str | None, language: str | None, ...)
Speech-to-Text with provider-agnostic API
llm
class
TTS
2 async7
(provider: str | None, voice: str | None, model: str | None, ...)
Text-to-Speech with provider-agnostic API
llm
class
Workspace
2
(root: str | Path, mode: WorkspaceMode)
Unified workspace configuration for all agent file operations

Agents

1
graph
class
Graph
3 async11
(nodes: dict[str, Any] | Sequence | None, edges: Sequence | None, entry: str | None, ...)
Production-ready workflow graph with zero-config building

MCP

4
mcp
class
CachingInterceptor
2
(ttl_seconds: int, _cache: dict[str, tuple[CallToolResult, float]])
Cache tool call results for a configurable TTL
mcp
class
MCPClient
12 async15
(config: list[dict] | list[McpServerConfig], callbacks: Callbacks | CallbackManager | None, interceptors: list[ToolCallInterceptor] | None, ...)
MCP Client for connecting to one or more MCP servers
mcp
class
MCPSecuritySettings
1
(domains: Sequence[str] | None, enable_security: bool, allowed_hosts: Sequence[str] | None, ...)
Security settings for MCP servers with automatic environment detection
mcp
class
MCPServer
1 async13
(strict: bool, health_path: str)
MCP Server for hosting one or more MCP endpoints

Embeddings & Retrieval

3
embeddings
class
Embeddings
3 async8
(provider: str | None, model: str | None, dimensions: int | None, ...)
Simple, provider-agnostic text embeddings
retriever
class
Retriever
7 async21
(provider: str | None, model: str | None, embeddings: Embeddings | None, ...)
Semantic search made simple
embeddings
class
VectorStore
1 async6
(embeddings: Embeddings, backend: Literal['memory', 'chroma', 'faiss'], collection_name: str, ...)
Simple vector store for semantic search

Evaluation

5
eval
class
ContainsExpected
1
(case_sensitive: bool)
Check if output contains the expected output text
eval
class
LengthInRange
1
(min_length: int, max_length: int | None, count_words: bool)
Check if output length is within a specified range
eval
class
RAGFaithfulness
1 async1
(llm_judge: str | None, provider: str | None, context_key: str, ...)
Evaluate if an answer is grounded in the provided context
eval
class
SemanticSimilarity
1
(provider: str | None, model: str | None, threshold: float, ...)
Evaluate semantic similarity between output and expected output
eval
class
ToolUsageEvaluator
1
(expected_tools: list[str], forbidden_tools: list[str], require_all: bool, ...)
Evaluate that an agent called expected tools

Callbacks & Observability

5
callbacks
class
CallbackManager
9 async27
(callbacks: Sequence[Callbacks] | None, critical_callbacks: Sequence[Callbacks] | None)
Manages multiple callback handlers
callbacks
class
Callbacks
2 async16
Base class for callback handlers
callbacks
class
LoggingCallbacks
6
(level: str)
Callback that logs all events to the ai-infra logger
callbacks
class
MetricsCallbacks
6
()
Callback that collects metrics about operations
callbacks
class
PrintCallbacks
6
(verbose: bool)
Simple callback that prints events to stdout

Image Generation

1
imagegen
class
ImageGen
1 async6
(provider: str | None, model: str | None, api_key: str | None, ...)
Provider-agnostic image generation

Providers

1
providers
class
ProviderRegistry
16
Central registry for all AI provider configurations