.env file.
Setup
Create a.env file in your project directory:
Required Configuration
These variables must be set for Longshot to run:LLM Provider
Base URL for an OpenAI-compatible LLM API.Examples:
- OpenAI:
https://api.openai.com/v1 - Anthropic (via proxy):
https://api.anthropic.com/v1 - Azure OpenAI:
https://YOUR_RESOURCE.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT - Local (Ollama):
http://localhost:11434/v1
API key for the LLM provider.
Git Configuration
URL of the target repository workers will clone and commit to.
GitHub Personal Access Token with push access to the target repository.Required permissions:
repo (full control of private repositories)LLM Configuration
Basic Settings
Model name to pass to the API. Any model accessible via your
LLM_BASE_URL works.Examples: gpt-5.3, gpt-4o, claude-opus-4-20250514, claude-sonnet-4-20250514Maximum tokens for LLM responses.
Sampling temperature for the LLM.
0.0= deterministic1.0= creative
Advanced LLM Settings
JSON array of endpoints for load balancing across multiple providers. Overrides
LLM_BASE_URL and LLM_API_KEY when set.Timeout for individual LLM requests in milliseconds. Unset = no timeout.
How long to wait for LLM endpoint readiness on startup (milliseconds).
Worker Configuration
Maximum number of parallel workers that can run simultaneously.
Worker timeout in seconds (default: 30 minutes).Workers exceeding this timeout will be terminated and marked as failed.
Sandbox Configuration
Longshot uses Modal for cloud sandboxes. Configure sandbox resources:CPU cores per Modal sandbox.
Memory per Modal sandbox in megabytes (default: 8GB).
Idle timeout before sandbox is terminated (seconds).
Docker image tag for sandboxes.
Git Configuration
Primary branch name in the target repository.
Prefix for worker branches. Workers create branches like
worker/task-1.Git identity name for commits made by Longshot.
Git identity email for commits made by Longshot.
Orchestrator Configuration
Merge strategy for incorporating worker changes.Options:
fast-forward- Fast-forward only (fails if not possible)rebase- Rebase worker branch onto mainmerge-commit- Create merge commit
Reconciler health check interval in seconds.The reconciler monitors build health and spawns fix tasks when issues are detected.
Run build/test sweep after all tasks complete.When enabled, Longshot runs a final verification pass and fixes any remaining issues.
Maximum reconciler fix attempts during finalization.
Timeout for finalization sweep in milliseconds.
Local Development
Path to the local clone of the target repository.
Python executable path.
Logging
Log level for output.Options:
debug, info, warn, errorMCP server port.
Example Configuration
Here’s a complete example.env file:
Next Steps
First Project
Build your first project with Longshot
Architecture
Understand how Longshot works under the hood