aibtc.dev is not liable for any lost, locked, or mistakenly sent funds. This is alpha software—use at your own risk. Any STX sent to you is owned by you, the trader, and may be redeemed, including profits or losses, at the end of the aibtc.dev Champions Sprint (~5 days). By participating, you accept that aibtc.dev is not responsible for any product use, costs, taxes incurred from trading STX or any other digital asset, or any other liability.
There are two ways to run the backend locally: using Conda (recommended for development) or Docker.
- Python 3.10
- Bun (for running TypeScript scripts)
- Git
- Conda (if using the Conda approach)
- Docker (if using the Docker approach)
- Clone the repository and initialize submodules:
git clone [repository-url]
cd aibtcdev-backend
git submodule init
git submodule update --remote
- Configure environment variables:
- Copy the
.env.example
file to.env
- Update the variables as needed
- Install Miniconda:
# On macOS
brew install miniconda
# Initialize conda (required after installation)
conda init "$(basename "${SHELL}")"
# Restart your terminal or source your shell configuration
source ~/.zshrc # for zsh
source ~/.bashrc # for bash
- Create and activate a new conda environment:
conda create --name aibackend python=3.10
conda activate aibackend
- Install Python dependencies:
pip install -r requirements.txt
- Set up the TypeScript tools:
cd agent-tools-ts/
bun install
cd ..
- Run the development server:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
- Build the Docker image:
docker build -t aibtcdev-backend .
- Run the container:
docker run -p 8000:8000 --env-file .env aibtcdev-backend
The API should be accessible at http://localhost:8000
. You can verify it's working by:
- Checking the health endpoint:
curl http://localhost:8000/
- Viewing the API documentation:
# Open in your browser
http://localhost:8000/docs
The backend provides several API endpoints:
/crew
- Crew management/public-crews
- Public crew information/public-stats
- Statistics/chat
- Chat functionality/metrics
- System metrics
For detailed API documentation, visit the /docs
endpoint when running the server.
- The main development branch is
feat/digitalocean
- Frontend corresponding branch is
feat/cloudflare
- The system uses OpenAI's API with rate limits depending on your tier
- Bun is used for TypeScript scripts, particularly for wallet operations
- Branch protection is enabled on
main
- Auto-deployment is configured for updates
- Pull requests require one approval
- Please ensure all tests pass before submitting a PR
If you encounter rate limit issues with OpenAI:
- Check your current tier limits at https://platform.openai.com/settings/organization/limits
- TPM (Tokens Per Minute) limits vary by tier:
- Tier 1: 200,000 TPM
- Tier 2: 2,000,000 TPM