Overview
Tool modes control how AXON executes tools declared in your programs:| Mode | Behavior | API Keys Required | Use Case |
|---|---|---|---|
| stub | Returns mock data | No | Development, testing, CI/CD |
| real | Calls production APIs | Yes | Production execution |
| hybrid | Prefers real, falls back to stubs | Partial | Mixed environments |
Configuration
Command-Line
Set the tool mode using the--tool-mode flag:
stub (if not specified)
Python API
Stub Mode
Description
Stub mode uses fake implementations for all tools. No external API calls are made, and all results are deterministic mock data.Usage
Behavior
Returns hardcoded search results with realistic structureExample Output:
Returns mock file contentsExample Output:
Returns mock execution results without running codeExample Output:
Returns mock PDF text extraction
Returns mock image analysis
Returns mock API responses
Always real — Uses Python stdlib for actual calculations
Always real — Uses Python stdlib for actual date/time operations
Advantages
- No API keys required — Works out of the box
- Fast execution — No network latency
- Deterministic — Same input = same output
- Cost-free — No API charges
- Safe for CI/CD — No external dependencies
Use Cases
-
Local Development
-
Unit Testing
-
CI/CD Pipelines
-
Learning AXON
Real Mode
Description
Real mode uses production backends for all tools. Requires API keys for external services.Usage
Behavior
Calls Serper.dev API for Google Search resultsRequires:
SERPER_API_KEYBackend: axon.runtime.tools.backends.web_search_serper.WebSearchSerperReads actual files from the filesystemRequires: File system accessBackend:
axon.runtime.tools.backends.file_reader_local.FileReaderLocalExecutes code using subprocess (Python, JavaScript, etc.)Requires: Installed interpreters (python3, node, etc.)Backend:
axon.runtime.tools.backends.code_executor_subprocess.CodeExecutorSubprocessAlways real — Python stdlib
Always real — Python stdlib
Not yet implemented — Falls back to stub
Not yet implemented — Falls back to stub
Not yet implemented — Falls back to stub
Advantages
- Production-ready — Real data, real results
- Accurate — Actual external service responses
- Complete functionality — Access to full tool capabilities
Use Cases
-
Production Execution
-
Integration Testing
-
Data Collection
Limitations
- Requires API keys — Must configure credentials
- Costs money — External APIs charge per request
- Network dependent — Requires internet connectivity
- Rate limits — Subject to provider quotas
Hybrid Mode (Recommended)
Description
Hybrid mode attempts to use real tool backends where API keys are available, falling back to stubs automatically when credentials are missing.Usage
Behavior
-
Initialization:
- Loads all stub implementations first
- Attempts to register real backends
- Real backends override stubs where successful
-
Execution:
- Uses real backend if API key available
- Falls back to stub if credentials missing
- Logs warnings for missing dependencies
-
Example Scenario:
Advantages
- Flexible — Works with partial credentials
- Graceful degradation — No hard failures
- Development-friendly — Add API keys incrementally
- Best of both worlds — Real tools where it matters, stubs where it doesn’t
Use Cases
-
Incremental Development
-
Team Environments
-
Cost Optimization
-
Gradual Rollout
Available Tools
Tool Status Matrix
| Tool | Stub | Real Backend | Always Real | Requires |
|---|---|---|---|---|
| WebSearch | ✓ | ✓ Serper.dev | No | SERPER_API_KEY |
| FileReader | ✓ | ✓ Local FS | No | File system access |
| CodeExecutor | ✓ | ✓ subprocess | No | Interpreters (python3, node) |
| Calculator | — | ✓ stdlib | Yes | — |
| DateTime | — | ✓ stdlib | Yes | — |
| PDFExtractor | ✓ | ✗ Planned | No | — |
| ImageAnalyzer | ✓ | ✗ Planned | No | — |
| APICall | ✓ | ✗ Planned | No | — |
Tool Registration
Tools are registered via theRuntimeToolRegistry:
Mode Selection Guide
Choose Stub Mode When:
- ✓ Developing locally without API keys
- ✓ Running unit tests
- ✓ Setting up CI/CD pipelines
- ✓ Learning AXON
- ✓ Avoiding API costs
- ✓ Need deterministic results
Choose Real Mode When:
- ✓ Running in production
- ✓ Need actual external data
- ✓ Integration testing
- ✓ Data collection/processing
- ✓ All required API keys available
Choose Hybrid Mode When:
- ✓ Developing with some API keys
- ✓ Team has mixed credentials
- ✓ Want graceful degradation
- ✓ Incrementally enabling real tools
- ✓ Optimizing costs (selective real tools)
- ✓ Recommended default for development
Examples
Development Workflow
Testing Strategy
Cost-Conscious Execution
Troubleshooting
Tool Backend Not Loading
{tool_name: is_stub} for all registered tools.
Missing API Key in Real Mode
Unexpected Stub Data
Symptom: Getting mock data when expecting real results. Solution: Check tool mode and API keys:Related Documentation
API Keys
Configure authentication
run Command
Execute with tool modes
