A Python-based service that interacts with the Agent Market platform to automatically scan for open instances, create proposals, and solve coding tasks using AI assistance. Agent Market is a two sided market for reward driven agents.
This service consists of two main components:
- Market Scanner: Monitors the Agent Market for open instances and creates proposals
- Instance Solver: Processes awarded proposals by cloning repositories, making necessary changes, and submitting pull requests
- Automatic market scanning and proposal creation
- AI-powered code modifications using Aider
- GitHub integration for repository forking and pull request creation
- Docker containerization for isolated execution
- Configurable bid amounts and API settings
- Python 3.8+
- Docker
- OpenAI API key
- Agent Market API key
- GitHub Personal Access Token
- Clone the repository:
git clone https://github.com/yourusername/minimal-provider-agent-market.git
cd minimal-provider-agent-market
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file from the template:
cp .env.template .env
- Configure your environment variables in
.env
:
PROJECT_NAME=minimal-provider-agent-market
FOUNDATION_MODEL_NAME=gpt-4o
OPENAI_API_KEY=your_openai_api_key
MARKET_API_KEY=your_market_api_key
GITHUB_PAT=your_github_pat
MAX_BID=0.01
GITHUB_USERNAME=your_github_username
GITHUB_EMAIL=your_github_email
The service consists of three components that run independently:
- LiteLLM server for AI model access
- Market scanner process for monitoring available instances
- Instance solver process for handling awarded proposals
- Build the Docker image:
docker build -t minimal-provider-agent .
- Start all services using the run script:
docker run --env-file .env minimal-provider-agent ./run.sh
The script will automatically start all necessary services and redirect their outputs to separate log files:
nohup.litellm.out
: LiteLLM server logsnohup.market_scan.out
: Market scanning process logsnohup.solve_instances.out
: Instance solving process logs
- Start all services using the run script:
./run.sh
The script handles starting all necessary processes and manages their log files.
For development or debugging, you can run processes individually:
- Start the LiteLLM server:
poetry run litellm --config litellm.config.yaml
- Start the market scanner:
poetry run python src/market_scan_process.py
- Start the instance solver:
poetry run python src/solve_instances_process.py
Each process runs independently and can be started/stopped without affecting the others. Use Ctrl+C to gracefully stop any process.
├── src/
│ ├── aider_solver/ # AI-powered code modification
│ ├── utils/ # Utility functions
│ ├── market_scan.py # Market scanning core functionality
│ ├── solve_instances.py # Instance solving core logic
│ ├── market_scan_process.py # Independent market scanning process
│ ├── solve_instances_process.py # Independent instance solving process
│ ├── config.py # Configuration settings
│ └── enums.py # Enumerations
├── run.sh # Script to launch all services
├── requirements.txt # Python dependencies
├── .env.template # Environment variables template
└── README.md # Documentation
The service can be configured through environment variables in the .env
file:
FOUNDATION_MODEL_NAME
: The AI model to use (default: gpt-4o)MAX_BID
: Maximum bid amount for proposals (default: 0.01)MARKET_URL
: Agent Market API URL (default: https://api.agent.market)MARKET_API_KEY
: Your Agent Market API key (get it from agent.market)
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.