infy itself.
The layers
Core
Pure Python, zero third-party runtime dependencies. Runnables, the
ChatModel protocol, parsers, tools, structured output, and the StateGraph runtime.Rust core
The optional
infy_core SIMD extension. Accelerates JSON parsing, cosine similarity, and tokenization, with a pure-Python fallback.Governance
The optional in-process control plane. Deny-by-default policy, risk tiering, human and durable approval, and a tamper-evident audit.
Providers
Optional extras. OpenAI, Anthropic, Gemini or Vertex, and Ollama, each behind the same
ChatModel protocol.The pure-Python core
The core is the whole framework. It has no third-party runtime dependencies, so it runs on a bare interpreter. It provides everything you need to build chains, agents, and stateful graphs.- Runnables.
Runnable,Sequence, andParallelcompose with the|operator. Plain callables, dicts, and tools are coerced automatically. - The
ChatModelprotocol. A single surface (generate,agenerate,stream,astream,bind_tools,with_structured_output) that every provider implements, so models are interchangeable in chains, agents, and graphs. - Parsers, tools, and structured output.
JsonParser, the@tooldecorator, andwith_structured_outputfor JSON-schema or pydantic results. - The
StateGraphruntime. A bulk-synchronous (Pregel-style) superstep executor with typed channels, reducers, conditional routing, dynamic fan-out, checkpointing, and interrupt or resume.
The Rust core
infy_core is an optional compiled extension. It accelerates the parsing and math hot paths with SIMD, but it is not required to run anything.
Build it into your active environment with
maturin develop --release.
Graceful degradation
This is the core guarantee: every module that uses the Rust extension falls back to a pure-Python implementation. The framework is fully functional withinfy_core absent. When you pip install infy, you get the Rust extension if a wheel is available for your platform, and the pure-Python fallback if it is not.
The fallback is transparent. Your code does not change, only the speed of the accelerated paths does. The pure-Python layer produces the same results.
- Providers are optional extras. Install only the ones you use (
infy[openai],infy[anthropic],infy[gemini],infy[ollama], orinfy[all]). - pydantic is optional. It is pulled in only for validated structured output (
infy[pydantic]), and only used when you opt in. - Governance is optional and imports nothing until you opt in. Omit it and nothing changes and nothing is imported.
The governance control plane
Governance is a separate, optional layer wired into the agent loop at the tool chokepoint. Opt in and every tool call is policy-checked in-process, and every step is written to a tamper-evident audit trail.- Policy, risk, and approval. Deny-by-default, fail-closed policy behind a
PolicyEngineprotocol, static risk tiering, and a pluggableApprover, includingDurableAgentfor out-of-band sign-off. - Tamper-evident audit. An append-only, SHA-256 or HMAC hash-chained log with
verify(). - Framework integrations.
infy.integrationswraps the tool or action chokepoint of smolagents, LangChain, and OpenHands agents with the same governance, without changing them.
Repository layout
Next steps
Quickstart
Install infy and run your first model call.
The graph runtime
Build stateful graphs with checkpointing and interrupts.
Governance
Give an agent real authority safely and prove what it did.
Providers
Connect OpenAI, Anthropic, Gemini, or Ollama.