{"id":22493575,"url":"https://github.com/bigsk1/btc-mempool-ai","last_synced_at":"2025-04-23T07:43:30.882Z","repository":{"id":246362178,"uuid":"820809455","full_name":"bigsk1/btc-mempool-ai","owner":"bigsk1","description":"Bitcoin Mempool AI Assistant is an advanced chatbot designed to provide real-time insights and information about Bitcoin transactions, blockchain data, and market trends","archived":false,"fork":false,"pushed_at":"2024-07-22T10:27:31.000Z","size":206,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T05:19:49.635Z","etag":null,"topics":["anthropic-claude","bitcoin","btc","llama3","mempool","mempool-explorer","ollama","openai","openai-api"],"latest_commit_sha":null,"homepage":"https://bigsk1.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigsk1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"bigsk1"}},"created_at":"2024-06-27T08:12:59.000Z","updated_at":"2024-11-16T14:11:28.000Z","dependencies_parsed_at":"2024-07-27T19:28:51.814Z","dependency_job_id":null,"html_url":"https://github.com/bigsk1/btc-mempool-ai","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"9a130122ccbee73e9f885040f7e87062a83606cf"},"previous_names":["bigsk1/btc-mempool-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigsk1%2Fbtc-mempool-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigsk1%2Fbtc-mempool-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigsk1%2Fbtc-mempool-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigsk1%2Fbtc-mempool-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigsk1","download_url":"https://codeload.github.com/bigsk1/btc-mempool-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250394522,"owners_count":21423360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anthropic-claude","bitcoin","btc","llama3","mempool","mempool-explorer","ollama","openai","openai-api"],"created_at":"2024-12-06T18:54:39.636Z","updated_at":"2025-04-23T07:43:30.858Z","avatar_url":"https://github.com/bigsk1.png","language":"Python","funding_links":["https://github.com/sponsors/bigsk1"],"categories":[],"sub_categories":[],"readme":"# ₿itcoin Mempool AI Assistant\n\n## Overview\n\nThe Bitcoin Mempool AI Assistant is an advanced chatbot designed to provide real-time insights and information about Bitcoin transactions, blockchain data, and market trends. Powered by state-of-the-art language models and integrating with live Bitcoin network data, this assistant offers a unique blend of AI capabilities and blockchain expertise.\n\n\n![bitcoin-mempool-ai](https://imagedelivery.net/WfhVb8dSNAAvdXUdMfBuPQ/2bd334cd-3e65-4d93-98ec-2d68f8f90a00/public)\n\n\n## Features\n\n- 📊 Real-time Bitcoin transaction analysis\n- 💼 Mempool insights and fee estimation\n- 🔍 Blockchain exploration and data retrieval\n- 📈 Market trends and price information\n- 🧠 General Bitcoin and blockchain knowledge\n\n## Technologies Used\n\n- Python\n- Chainlit\n- OpenAI GPT models\n- Anthropic Claude models\n- Ollama (for local model deployment)\n- Mempool Space API (no api key needed)\n\n## Setup\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/bigsk1/btc-mempool-ai.git\n   cd btc-mempool-ai\n   ```\n\n2. Create a virtual environment and activate it:\n   ```\n   python -m venv venv\n   source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n   ```\n\n3. Install the required dependencies:\n   ```\n   pip install -r requirements.txt\n   ```\n\n4. Set up your environment variables:\n   Create a `.env` file in the project root and add your API keys:\n   ```\n   # You have the option to use any of the AI Providers below\n   \n   OPENAI_API_KEY=api_key\n\n   ANTHROPIC_API_KEY=api_key\n\n   AI_PROVIDER=openai  # or anthropic or ollama\n\n   AI_MODEL=gpt-4o     # or your preferred model\n\n   OLLAMA_BASE_URL=http://localhost:11434  #  http://host.docker.internal:11434    \n   ```\n\n5. If using Ollama, ensure it's installed and the desired model is pulled before running:\n   ```\n   ollama pull llama3    # or your preferred model\n   ```\n\n## Usage\n\nTo start the Bitcoin Mempool AI Assistant:\n\n```\nchainlit run app.py -w\n```\n\nNavigate to `http://localhost:8000` in your web browser to interact with the assistant.\n\n### Example Queries\n\n- \"What's the current Bitcoin price?\"\n- \"Show me the mempool fee distribution for the last 24 hours.\"\n- \"Explain the latest difficulty adjustment in Bitcoin mining.\"\n- \"What's the transaction history for this Bitcoin address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\"\n- \"Graph the Bitcoin price change over the last month.\"\n\n\n## Configuration\n\nYou can customize the assistant's behavior by modifying the .env file. Change the AI_PROVIDER and AI_MODEL variables to switch between different AI providers and models.\n\n\n\nYou can customize the assistant's behavior and appearance by modifying the `.chainlit/config.toml` file. Refer to the Chainlit documentation for more details on configuration options.\n\n---\n\n\n![mem1](https://imagedelivery.net/WfhVb8dSNAAvdXUdMfBuPQ/82844360-af76-42d2-9163-e0ba7fe44e00/public)\n\n\n---\n\n![mem2](https://imagedelivery.net/WfhVb8dSNAAvdXUdMfBuPQ/51cb8776-46b0-409f-1979-f1b8ce552000/public)\n\n\n## GPT from OpenAI\n\nI also made a custom GPT from openai's gpt store, which has similar functionalities and api calls to mempool, it can be found here  [https://chatgpt.com/g/g-fhvMWr0qz-btc-mempool-ai](https://chatgpt.com/g/g-fhvMWr0qz-btc-mempool-ai)\n\n\n\n## Docker Setup and Usage\n\nThis project uses Docker to ensure consistent environments and easy deployment. Follow these steps to get started with Docker:\n\n### Prerequisites\n\n- Docker installed on your system\n- Docker Compose installed on your system\n\n### Building the Docker Image\n\nTo build the Docker image for the Bitcoin Mempool AI Assistant:\n\n```bash\ndocker-compose build\n```\n\n### Running the Container\n\nTo start the container:\n\n```bash\ndocker-compose up -d\n```\n\nThe `-d` flag runs the container in detached mode.\n\n### Viewing Logs\n\nTo view the logs of the running container:\n\n```bash\ndocker-compose logs -f\n```\n\n### Stopping the Container\n\nTo stop the running container:\n\n```bash\ndocker-compose down\n```\n\n### Changing AI Provider\n\nYou can easily switch between different AI providers (OpenAI, Anthropic, Ollama) without rebuilding the container. Use the provided script:\n\n1. Make the script executable (first time only):\n   ```bash\n   chmod +x switch_provider.sh\n   ```\n\n2. Run the script to switch providers:\n   ```bash\n   ./switch_provider.sh [openai|anthropic|ollama] [model_name]\n   ```\n\n   Example:\n   ```bash\n   ./switch_provider.sh openai gpt-4\n   ```\n\n   Or use the default model for a provider:\n   ```bash\n   ./switch_provider.sh anthropic\n   ```\n\n### Environment Variables\n\nThe following environment variables can be set in your `.env` file:\n\n- `OPENAI_API_KEY`: Your OpenAI API key\n- `ANTHROPIC_API_KEY`: Your Anthropic API key\n- `OLLAMA_BASE_URL`: URL for Ollama (default: http://localhost:11434)\n- `AI_PROVIDER`: The AI provider to use (openai, anthropic, or ollama)\n- `AI_MODEL`: The specific model to use with the chosen provider\n\n### Accessing the Application\n\nOnce the container is running, you can access the Bitcoin Mempool AI Assistant at:\n\n```\nhttp://localhost:8000\n```\n\n### Troubleshooting\n\nIf you encounter any issues:\n\n1. Ensure all required environment variables are set in your `.env` file.\n2. Try rebuilding the image without cache:\n   ```bash\n   docker-compose build --no-cache\n   ```\n3. Check the logs for any error messages:\n   ```bash\n   docker-compose logs -f\n   ```\n\nFor more detailed information about the project structure and API usage, refer to the sections above in this README.\n\n\n\n## Contributing\n\nContributions to the Bitcoin Mempool AI Assistant are welcome! Please feel free to submit pull requests, create issues or spread the word.\n\n## License\n\nThis project is licensed under the MIT License\n\n## Acknowledgments\n\n- Bitcoin Mempool Space for their comprehensive API\n- The Chainlit team for their excellent chat interface framework\n- OpenAI, Anthropic, and the Ollama project for their powerful language models\n\n## Disclaimer\n\nThis assistant is for informational purposes only and should not be considered financial advice. Always do your own research and consult with a qualified financial advisor before making any investment decisions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigsk1%2Fbtc-mempool-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigsk1%2Fbtc-mempool-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigsk1%2Fbtc-mempool-ai/lists"}