{"id":47749621,"url":"https://github.com/beefy/workoutassistant","last_synced_at":"2026-04-03T02:51:38.862Z","repository":{"id":339101432,"uuid":"1160475791","full_name":"beefy/workoutassistant","owner":"beefy","description":"Email based AI assistant","archived":false,"fork":false,"pushed_at":"2026-03-14T02:52:11.000Z","size":32936,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-14T14:08:58.779Z","etag":null,"topics":["ai-agent","ai-assistant","algotrading","cryptocurrency","email","llm","moltbook","raspberry-pi","solana","webcrawling"],"latest_commit_sha":null,"homepage":"https://bobtheraspberrypi.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beefy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-18T01:32:36.000Z","updated_at":"2026-03-14T02:52:14.000Z","dependencies_parsed_at":"2026-03-04T22:06:57.924Z","dependency_job_id":null,"html_url":"https://github.com/beefy/workoutassistant","commit_stats":null,"previous_names":["beefy/workoutassistant"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beefy/workoutassistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefy%2Fworkoutassistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefy%2Fworkoutassistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefy%2Fworkoutassistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefy%2Fworkoutassistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beefy","download_url":"https://codeload.github.com/beefy/workoutassistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefy%2Fworkoutassistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31329388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T02:17:30.558Z","status":"ssl_error","status_checked_at":"2026-04-03T02:17:30.071Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai-agent","ai-assistant","algotrading","cryptocurrency","email","llm","moltbook","raspberry-pi","solana","webcrawling"],"created_at":"2026-04-03T02:51:38.231Z","updated_at":"2026-04-03T02:51:38.848Z","avatar_url":"https://github.com/beefy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# workoutassistant\n\nAn LLM that will answer emails. Capable of running on a raspberry pi with 6gb of RAM.\n\n - Email uses gmail SMTP/IMAP\n - LLM uses phi-3-mini and runs locally\n - Image captioning uses blip and runs locally\n - Image generation runs in the cloud using a hugging face interface (free)\n - Image to image (image editing) runs in the cloud using a hugging face interface ($0.02 to $0.03 per call) \n - Approve List for approved email senders is stored in SQLite\n - Web search uses duck duck go\n\nTasks that run on a regular schedule:\n\n - Heartbeat\n - Check and process emails\n - Create and send a daily newsletter based on the front page news of apnews.com\n - Browse Moltbook, making posts, making comments, or upvoting/downvoting posts\n - Trade cryptocurrency on the Solana blockchain based on 5 indicators from the last 72 hours of price data\n\n### Environment Variables\n\nSee `.variables.example` for expected environment variables.\n\n### Docker Commands\n\nInstall\n```\n# Install Docker\ncurl -fsSL https://get.docker.com -o get-docker.sh\nsudo sh get-docker.sh\nsudo usermod -aG docker $USER\n\n# Install Docker Compose (if not included)\nsudo apt install docker-compose-plugin\n```\n\nEnsure it starts on boot\n```\nsudo systemctl enable docker\n```\n\nCommands\n```bash\n# View logs\ndocker compose logs -f workoutassistant\n\n# Check status\ndocker compose ps\n\n# Update to latest version\ndocker compose pull \u0026\u0026 docker compose up -d\n\n# Stop containers\ndocker compose down\n\n# Restart\ndocker compose restart\n\n# SSH into the docker container\ndocker exec -it workoutassistant /bin/bash\ncat /app/logs/output.log\n\n# Fix permissions issue\ndocker exec -it --user root workoutassistant chmod -R 777 /app/src/generated_images\n\n# Build locally\nnohup docker build -t workoutassistant-local . \u003e docker-build.log 2\u003e\u00261 \u0026\n\n# Run with local image override\ndocker-compose up -d workoutassistant\n```\n\nTo fix permission denied error\n```\n# First, check if docker group exists\ngrep docker /etc/group\n\n# If docker group doesn't exist, create it:\nsudo groupadd docker\n\n# Add your user to docker group\nsudo usermod -aG docker $USER\n\n# Verify the user was added (should show your username)\ngetent group docker\n\n# MUST logout/login or restart SSH session for permanent fix\nreboot\n\n# Temporary fix for current session only:\nnewgrp docker\n\n# After logout/login, verify it worked:\ngroups | grep docker\ndocker ps\n```\n\nMore setup\n```\nmkdir -p ./logs ./data ./generated_images \u0026\u0026 chmod 755 ./logs ./data ./generated_images\n```\nor\n```\nsudo chown -R $USER:$USER ./logs ./data ./generated_images 2\u003e/dev/null || echo \"Some directories don't exist yet - that's ok\"\n```\n\nTo make docker start on startup\n```\nsudo systemctl enable docker\nsudo systemctl enable docker.socket\n```\n\nTo make docker not start on startup\n```\nsudo systemctl disable docker\nsudo systemctl disable docker.socket\n```\n\nTo start docker\n```\nsudo systemctl start docker\nsudo systemctl start docker.socket\n```\n\nTo check if docker is running\n```\nsudo systemctl status docker\n```\n\nTo check docker events\n```\ndocker events\n```\n\n### System Monitoring\n```bash\n# Monitor temperature\nvcgencmd measure_temp\n\n# Check throttling status\nvcgencmd get_throttled\n\n# Monitor power supply\nvcgencmd measure_volts\n```\n\n### 🔄 Automatic Updates\n\nThe deployment includes a script which:\n- Polls DockerHub every 5 minutes for new images\n- Automatically pulls and deploys updates\n\n\nTo run it\n```\n# Edit crontab\ncrontab -e\n\n# Add this line (checks for updates every 5 minutes):\n*/5 * * * * /home/bob/Code/workoutassistant/src/scripts/update_cron.sh \u003e\u003e /home/bob/Code/workoutassistant/update.log 2\u003e\u00261\n```\n\n\n### Setting Up CI/CD\n\nTo set up automatic Docker image building and publishing:\n\n**Set up DockerHub account** and create a repository named `workoutassistant`\n\n**Configure GitHub Secrets** in your repository settings:\n   - Go to Settings → Secrets and variables → Actions\n   - Add these repository secrets:\n     - `DOCKERHUB_USERNAME`: Your DockerHub username\n     - `DOCKERHUB_TOKEN`: Your DockerHub access token ([create one here](https://hub.docker.com/settings/security))\n\n### 🏥 Health Monitoring\n\nThe container includes health checks that monitor if the main process is running. Container will restart automatically if health checks fail.\n\n### 🔧 Troubleshooting\n\n**Container won't start:**\n- Check if `~/.variables` file exists and has the required variables\n- Verify Docker is running: `sudo systemctl status docker`\n- Check logs: `docker compose logs workoutassistant`\n\n### Prerequisites\n\nInstall system dependencies:\n```bash\n# Headless web search\nsudo apt install -y chromium chromium-driver\n\n# Python and pip (usually pre-installed)\nsudo apt install -y python3 python3-pip\n\n# SQLite (usually pre-installed)\nsudo apt install -y sqlite3\n```\n\n### Install Python Dependencies\n\n```bash\n# Clone the repository\ngit clone https://github.com/YOUR_USERNAME/workoutassistant.git\ncd workoutassistant\n\n# Install Python packages\npip install -r requirements.txt\n```\n\n### Setup Local LLM\n\n```\n# Create models directory\nmkdir -p ~/models\ncd ~/models\n\n# Download Phi-3-mini 4k version (~2.4GB)\nwget https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf/resolve/main/Phi-3-mini-4k-instruct-q4.gguf\n\n# Download Phi-3-mini 128k version for longer context windows\nwget https://huggingface.co/mradermacher/Phi-3-mini-128k-instruct-ft-i1-GGUF/resolve/main/Phi-3-mini-128k-instruct-ft.i1-Q4_K_M.gguf?download=true\n```\n\nYou may need to create a hugging face user and browse the web UI for models: https://huggingface.co/docs/huggingface_hub/v1.4.0/quick-start#authentication\n\n### Local Image Captioning Setup\n\nThe image captioning module automatically downloads the BLIP-base model (~1.2GB) on first use. For manual installation:\n\n```bash\n# Install required packages\npip install torch transformers pillow\n\n# Test the image captioning (will auto-download model)\npython src/image_captioning.py\n```\n\n**Model Details:**\n- **Model**: Salesforce BLIP-base (blip-image-captioning-base)\n- **Size**: ~1.2GB download\n- **RAM Usage**: ~2-3GB during inference\n- **Performance**: 10-30 seconds per image on Raspberry Pi, 2-5 seconds on desktop CPU\n- **Capabilities**: Image captioning and visual question answering\n\n**Raspberry Pi Optimization:**\n- Uses CPU-only inference (no GPU required)\n- Optimized for low memory usage with `low_cpu_mem_usage=True`\n- Automatically detected Pi hardware for performance messaging\n\n**Usage Example:**\n```python\nfrom src.image_captioning import caption_image_local, ask_about_image_local\n\n# Basic image captioning\ncaption = caption_image_local('path/to/image.jpg')\nprint(f\"Caption: {caption}\")\n\n# Visual question answering\nanswer = ask_about_image_local('path/to/image.jpg', 'What colors are in this image?')\nprint(f\"Answer: {answer}\")\n```\n\n### SQLite Database Setup\n\nSQLite comes pre-installed on most systems. To verify:\n\n```bash\n# Check if SQLite is installed\nsqlite3 --version\n\n# If not installed:\n# Ubuntu/Debian:\nsudo apt-get install sqlite3\n\n# macOS (if not present):\nbrew install sqlite\n\n# CentOS/RHEL:\nsudo yum install sqlite\n```\n\nCreate the initial tables\n```\nPYTHONPATH=src python src/scripts/create_tables.py\n```\n\n### Email setup\n\n1. Create a gmail account for this project\n2. Enable 2FA\n3. Generate an App Password: https://myaccount.google.com/apppasswords\n\nStore the necessary environment variables\n```\nexport GMAIL_ADDRESS=\u003cemail@gmail.com\u003e\nexport GMAIL_APP_PASSWORD=\u003capp_password\u003e\nexport TEST_EMAIL=\u003cemailtosendtestemailto@gmail.com\u003e\nexport ADMIN_EMAIL=\u003cadminemail@gmail.com\u003e\nexport APPROVED_PHRASE=\u003cphrase to add to approve list\u003e\n```\n\n### Moltbook setup\n```\ncurl -X POST https://www.moltbook.com/api/v1/agents/register \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"YourAgentName\", \"description\": \"What you do\"}'\n```\n\n```\nexport MOLTBOOK_API_KEY=\u003capi_key\u003e\n```\n\n### API integration for tracking status\n```\nexport TRACKING_API_USERNAME=\u003cusername\u003e\nexport TRACKING_API_PASSWORD=\u003cpassword\u003e\n```\n\nCreate account\n```\npython src/scripts/register_tracking_api.py\n```\n\n### Crypto Setup\n\nCreate crypto wallets\n```\npython src/scripts/create_crypto_wallets.py\n```\n\nAcquire and set these environment variables\n```\nexport SOLANA_ADDRESS=\u003cwallet to trade from\u003e\nexport SOLANA_PRIVATE_KEY=\u003cbase 58 private key for wallet\u003e\nexport JUPITER_API_KEY=\u003capi key for getting trade info\u003e\nexport BIRDEYE_API_KEY=\u003capi key for getting price data\u003e\n```\n\nCheck crypto balance\n```\npython src/scripts/get_crypto_balance.py\n```\n\n### Lichess Setup\nCreate a new account on Lichess. Convert it to a bot account with this curl command. Note: the account cannot have any games played.\n```\ncurl -d '' https://lichess.org/api/bot/account/upgrade -H \"Authorization: Bearer \u003cyour api token\u003e\"\n{\"ok\":true}\n```\n\n### Youtube / Discord Setup\n```\nbrew install ffmpeg\n```\nSee DISCORD_BOT_README.md\n\n### Run the script\n\nStart it in the background\n```\n# Use -u flag for unbuffered output and full path for log file\nnohup python -u src/main.py \u003e $(pwd)/output.log 2\u003e\u00261 \u0026\n\n# Alternative: Set PYTHONUNBUFFERED environment variable\nnohup env PYTHONUNBUFFERED=1 python src/main.py \u003e $(pwd)/output.log 2\u003e\u00261 \u0026\n```\n\nFind the process to kill it when done\n```\n# Find by script name\nps aux | grep src/main.py\n```\n\nMonitor the output in real-time\n```\n# Follow the log file continuously (Ctrl+C to stop)\ntail -f output.log\n\n# Alternative: Show last 50 lines then follow\ntail -n 50 -f output.log\n\n# Less command with follow mode (F key to follow, q to quit)\nless +F output.log\n```\n\nKill the process\n```\n# Kill by PID\nkill 12345\n\n# Force kill\nkill -9 12345\n```\n\n### Run the gh actions runner\n\n```\nnohup ./run.sh \u003e output.log 2\u003e\u00261 \u0026\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeefy%2Fworkoutassistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeefy%2Fworkoutassistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeefy%2Fworkoutassistant/lists"}