Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 1.8 KB

File metadata and controls

60 lines (45 loc) · 1.8 KB

Setup

Prerequisites

  • Python 3.11+
  • pip
  • Optional: Docker

Environment Variables

Variable Required Example Purpose
DEFAULT_PROVIDER Yes gcp Selects LLM provider (gcp or siliconeflow).
GCP_MODEL_URL Required when DEFAULT_PROVIDER=gcp https://.../generate GCP model endpoint for generation.
SILICONEFLOW_API_KEY Required when DEFAULT_PROVIDER=siliconeflow sk-... SiliconeFlow auth token.
SILICONEFLOW_URL Required when DEFAULT_PROVIDER=siliconeflow https://api.siliconeflow.com/v1/chat SiliconeFlow API URL.
DATABASE_URL Recommended sqlite:///./data/shopmind.db Persistence backend (SQLite/Postgres).
ALLOWED_ORIGINS Recommended https://shopmindai-backend.azurewebsites.net CORS policy.
LOG_LEVEL No INFO Logging verbosity.
MAX_RETRIEVE_DOCS No 10 Retrieval count cap.

Local Development

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

Smoke Checks

curl -s http://localhost:8000/health
curl -s http://localhost:8000/metrics | head -n 20

Azure Deployment Runbook

  1. Create App Service (Linux, Python runtime).
  2. Deploy source from GitHub repo fuaadabdullah/shopmind-ai.
  3. Set startup command:
uvicorn app.main:app --host 0.0.0.0 --port 8000
  1. Set required app settings (all secrets server-side only).
  2. Verify:
curl -s https://shopmindai-backend.azurewebsites.net/health

Troubleshooting

  • Provider errors: verify provider env vars and credentials.
  • 500 on diagnose: confirm database connectivity and provider endpoint reachability.
  • CORS issues: verify ALLOWED_ORIGINS includes frontend origin.