Starting the Dev Server
Project Detection
The CLI identifies Python projects by checking for:pyproject.toml- Python project manifestagentmark_client.py- AgentMark client configuration.agentmark/dev_server.py- Auto-generated entry point
Virtual Environment Detection
The CLI automatically detects and uses virtual environments:Entry Point Resolution
The dev server entry point is resolved in this order:| Location | Description |
|---|---|
dev_server.py | Custom dev server (project root) |
.agentmark/dev_server.py | Auto-generated server |
Custom Dev Server
Create adev_server.py in your project root to customize the webhook server:
dev_server.py
Auto-Generated Server
When you runnpm create agentmark@latest, an entry point is created at .agentmark/dev_server.py:
.agentmark/dev_server.py
Environment Variables
The dev server sets the following environment variables:| Variable | Value | Description |
|---|---|---|
PYTHONDONTWRITEBYTECODE | 1 | Prevents __pycache__ creation |
PYTHONUNBUFFERED | 1 | Ensures real-time output |
AGENTMARK_BASE_URL | http://localhost:{api_port} | API server URL for telemetry |
Server Architecture
When you runagentmark dev, three servers start:
- Receives prompt execution requests from the CLI
- Uses your
agentmark_client.pyconfiguration - Executes prompts via the configured adapter (Pydantic AI or Claude Agent SDK)
- Returns streaming or non-streaming responses
Port Configuration
Override default ports with CLI options:| Option | Default | Description |
|---|---|---|
--webhook-port | 9417 | Webhook server port |
--api-port | 9418 | API server port |
--app-port | 3000 | UI server port |
Webhook Handler
The webhook server implements two event types:prompt-run
Executes a single prompt:dataset-run
Executes a prompt across a dataset:Running Prompts
With the dev server running, execute prompts from another terminal:Troubleshooting
Virtual Environment Not Found
If you see “python not found” errors:Module Not Found
Ensure dependencies are installed in the correct virtual environment:Port Already in Use
If ports are busy, specify alternative ports:agentmark_client.py Not Found
The CLI requiresagentmark_client.py in your project root:
Adapter-Specific Considerations
Pydantic AI
The Pydantic AI dev server usesaiohttp for async HTTP handling:
Claude Agent SDK
The Claude Agent SDK dev server handles agentic execution:Next Steps
Python Overview
Python SDK and project setup
Pydantic AI
Type-safe LLM interactions
Claude Agent SDK
Agentic task execution
Running Prompts
Execute prompts from CLI
Have Questions?
We’re here to help! Choose the best way to reach us:
- Join our Discord community for quick answers and discussions
- Email us at [email protected] for support
- Schedule an Enterprise Demo to learn about our business solutions