Public API index
The package root is the stable import surface:
from executionkit import Provider, TokenUsage, consensus
Names listed here come from executionkit.__all__. Import internal modules
only when a guide explicitly identifies an advanced extension point.
Patterns
| Name |
Purpose |
Reference |
consensus |
Vote across independent completions. |
Patterns |
refine_loop |
Generate, score, and revise. |
Patterns |
react_loop |
Run a bounded model/tool loop. |
Patterns |
structured |
Parse, validate, and repair JSON. |
Patterns |
pipe |
Pass one pattern result to the next. |
Patterns |
map_reduce |
Map across inputs and reduce the results. |
Patterns |
consensus_sync |
Synchronous wrapper for consensus. |
Patterns |
refine_loop_sync |
Synchronous wrapper for refine_loop. |
Patterns |
react_loop_sync |
Synchronous wrapper for react_loop. |
Patterns |
structured_sync |
Synchronous wrapper for structured. |
Patterns |
pipe_sync |
Synchronous wrapper for pipe. |
Patterns |
map_reduce_sync |
Synchronous wrapper for map_reduce. |
Patterns |
Pattern values and protocols
| Name |
Purpose |
Reference |
PatternResult |
Completed pattern value, score, cost, and metadata. |
Patterns |
StreamingPatternResult |
Async text stream with a live cost view. |
Patterns |
TokenUsage |
Input-token, output-token, and call counts. |
Patterns |
Tool |
Registered async tool definition. |
Patterns |
VotingStrategy |
majority or unanimous. |
Patterns |
TerminationReason |
Reason a loop stopped. |
Patterns |
Evaluator |
Async response-score callback type. |
Patterns |
CheckpointCallback |
Loop checkpoint callback type. |
Patterns |
PatternStep |
Callable protocol accepted by pipe. |
Patterns |
Providers and responses
| Name |
Purpose |
Reference |
Provider |
OpenAI-compatible chat-completions HTTP client. |
Providers |
LLMProvider |
Structural protocol for non-streaming providers. |
Providers |
ToolCallingProvider |
Provider protocol with tool-call support. |
Providers |
StreamingProvider |
Provider protocol with an async text stream. |
Providers |
LLMResponse |
Parsed provider response. |
Providers |
ToolCall |
Parsed model-requested tool call. |
Providers |
MockProvider |
Scripted provider for tests. |
Providers |
ClaudeAgentProvider |
Claude Agent SDK transport authenticated by a Claude subscription sign-in. |
Providers |
Session and execution controls
| Name |
Purpose |
Reference |
Kit |
Provider session with cumulative usage and optional conversation state. |
Execution helpers |
RetryConfig |
Retry count, delay, exception, and rate-limit policy. |
Execution helpers |
DEFAULT_RETRY |
Default retry configuration. |
Execution helpers |
TokenBucket |
Async call pacing and cooldown. |
Execution helpers |
CostTracker |
Mutable token and call accumulator. |
Execution helpers |
estimate_cost |
Apply caller-supplied token rates. |
Execution helpers |
ConvergenceDetector |
Score-threshold and stalled-progress detector. |
Execution helpers |
extract_json |
Extract a JSON object or array from model text. |
Patterns |
validate_score |
Require a finite score in [0.0, 1.0]. |
Patterns |
checked_complete |
Advanced budgeted/retried completion helper. |
Patterns |
checked_stream |
Advanced budgeted/retried streaming helper. |
Patterns |
Routing, workflows, plans, and approval
Tracing
Evaluation
| Name |
Purpose |
Reference |
EvalCase |
One run/check pair. |
Evaluation |
EvalResult |
One case result. |
Evaluation |
EvalReport |
Aggregate results and accuracy. |
Evaluation |
run_eval_suite |
Run cases in order. |
Evaluation |
Turn |
One checked conversation turn. |
Evaluation |
ConversationScript |
Ordered conversation turns. |
Evaluation |
run_conversation_script |
Evaluate a script with one Kit. |
Evaluation |
live_provider_from_env |
Build an opt-in live provider from environment variables. |
Evaluation |
Anthropic Message Batches
| Name |
Purpose |
Reference |
AnthropicBatchClient |
Minimal native Message Batches HTTP client. |
Batch API |
consensus_batch |
Run consensus samples as one batch job. |
Batch API |
map_batch |
Submit several prompts and return ordered responses. |
Batch API |
Exceptions
__version__ is the installed package version.