Downloads ยท 30 days
0
bjpromptly/garmin-agent
garmin-agent is a machine learning model from bjpromptly. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Your personalized AI fitness assistant powered by Garmin Connect data. Analyse your activities, track progress, and get intelligent coaching recommendations through a conversational interface.
Downloads ยท 30 days
0
Access
Public
Updated Oct 2, 2025
Repo size
โ
Likes
0
Public
Click a slice to open those files.
.txt13.6 KB ยท 51%
From the Hugging Face model README
Your personalized AI fitness assistant powered by Garmin Connect data. Analyse your activities, track progress, and get intelligent coaching recommendations through a conversational interface.
This guide explains how to deploy the Garmin AI Coach application to HuggingFace Spaces.
pip install huggingface_hub[cli]Use the deployment script from repository root:
# Generate requirements.txt
./infrastructure/deployment/scripts/generate-requirements.sh
# Deploy to HuggingFace Spaces
./infrastructure/deployment/scripts/deploy-to-hf.sh
huggingface-cli login
Create a private Space:
garmin-agent (or your preferred name)Prepare deployment files:
# From repository root
cd infrastructure/deployment/scripts
./generate-requirements.sh
# Copy files to repository root
cp infrastructure/deployment/huggingface/app.py ./app.py
cp infrastructure/deployment/huggingface/requirements.txt ./requirements.txt
cp infrastructure/deployment/huggingface/README.md ./README.md
# Clone your Space repository
git clone https://huggingface.co/spaces/YOUR_USERNAME/garmin-agent
cd garmin-agent
# Copy application files and workspace
cp /path/to/repo/app.py ./
cp /path/to/repo/requirements.txt ./
cp /path/to/repo/README.md ./
cp -r /path/to/repo/packages ./
cp -r /path/to/repo/services ./
# Commit and push
git add .
git commit -m "Initial deployment"
git push
Configure Secrets and Variables:
Go to your Space Settings:
Required Secret (Settings โ Secrets):
GOOGLE_CREDENTIALS_JSON: Paste the entire contents of your service account key JSON file
{
"type": "service_account",
"project_id": "savvy-bit-472903-g9",
...
}
Required Variables (Settings โ Variables):
DATABASE_TYPE=firestoreGOOGLE_CLOUD_PROJECT=savvy-bit-472903-g9ENABLE_AUTH=trueENVIRONMENT=productionCHAT_AGENT_MODEL=hf:meta-llama/Llama-3.2-3B-InstructOptional Variables:
HUGGINGFACE_HUB_TOKEN: Your HF token (required for HF models)TELEMETRY_BACKEND=disabled: Telemetry configurationRestart Space: After configuring secrets, restart your Space from the Settings page.
HuggingFace Spaces requires the following structure at repository root:
repository-root/
โโโ app.py # Entry point (from infrastructure/deployment/huggingface/app.py)
โโโ requirements.txt # Generated dependencies
โโโ README.md # This file with HF metadata header
โโโ packages/ # Full workspace structure
โ โโโ ai-core/
โ โโโ shared-config/
โโโ services/
โโโ cli/
โโโ web-app/
Important: Deploy the entire workspace structure to maintain package imports and dependencies.
| Variable | Required | Description | Example |
|---|---|---|---|
GOOGLE_CREDENTIALS_JSON | Yes (Secret) | Service account key JSON content | See Terraform outputs |
DATABASE_TYPE | Yes | Database backend type | firestore |
GOOGLE_CLOUD_PROJECT | Yes | GCP project ID | savvy-bit-472903-g9 |
ENABLE_AUTH | Yes | Enable multi-user authentication | true |
ENVIRONMENT | Yes | Deployment environment | production |
CHAT_AGENT_MODEL | Yes | AI model specification | hf:meta-llama/Llama-3.2-3B-Instruct |
HUGGINGFACE_HUB_TOKEN | Conditional | HF token for HF models | hf_xxxxx |
TELEMETRY_BACKEND | No | Telemetry configuration | disabled |
In your Space:
GOOGLE_CREDENTIALS_JSON is set in Settings โ Secrets4. "Firestore connection failed"
roles/datastore.user permissionGOOGLE_CLOUD_PROJECT matches your Firestore project5. "Model not found" or authentication errors
HUGGINGFACE_HUB_TOKEN in VariablesOPENAI_API_KEYANTHROPIC_API_KEYAfter deployment:
https://huggingface.co/spaces/YOUR_USERNAME/garmin-agentTo update your deployed application:
Update code locally and test
Regenerate requirements.txt if dependencies changed:
./infrastructure/deployment/scripts/generate-requirements.sh
Copy updated files to Space repository
Commit and push changes
HF Spaces will automatically rebuild and restart
ENABLE_AUTH=trueaustralia-southeast1 optimises latency for APAC usersFor issues specific to:
Note: This deployment uses HuggingFace Spaces' native Gradio SDK support. The platform automatically handles server configuration, port binding, and SSL certificates.