Installation
Prerequisites
- Python 3.12 or higher
- uv package manager
Install Dependencies
Clone the repository and install dependencies using uv:
git clone https://github.com/svilupp/layercode-create-app.git
cd layercode-create-app
uv sync --group dev
This will install all required dependencies including:
- FastAPI and Uvicorn for the web server
- PydanticAI for agent orchestration
- Logfire and Loguru for observability
- Development tools (pytest, mypy, ruff)
Environment Setup
Copy the example environment file:
Edit .env with your credentials:
# Required - Get these from your LayerCode dashboard
LAYERCODE_API_KEY=lk_live_...
LAYERCODE_WEBHOOK_SECRET=whsec_...
# Required - Your AI provider API key
OPENAI_API_KEY=sk-...
# OR for Google models:
# GOOGLE_GENERATIVEAI_API_KEY=...
# Optional
LOGFIRE_TOKEN=lf_...
DEFAULT_MODEL=openai:gpt-5-nano
Getting LayerCode Credentials
- Sign up at LayerCode
- Create a new agent in the dashboard
- Copy your API key and webhook secret
- Paste them into your
.envfile
AI Provider Setup
You'll need an API key from one of the supported providers:
- OpenAI: Get your API key from platform.openai.com
- Google: Get your API key from Google AI Studio
Verify Installation
Test that everything is working:
# List available agents
uv run layercode-create-app list-agents
# Run the echo agent (doesn't require AI credentials)
uv run layercode-create-app run --agent echo
You should see the server start on http://0.0.0.0:8000.
Next Steps
- Quickstart Guide - Run your first agent
- Configuration - Learn about all configuration options