HNTAI / services /ai-service /README.md
Adhil Krishna G
Deployed to Live
5aafb3a
|
Raw
History Blame
1.1 kB

AI Service (ai_med_extract)

Quick dev notes for the migrated ai_med_extract service.

Run a lightweight smoke test (does not initialize models):

python run_smoke_test.py

Create the Flask app without loading models:

from ai_med_extract import create_app
app = create_app()

# The app is ready for tests; call initialize_agents(app, preload_small_models=False)
# to wire routes with lazy/fallback agents that avoid downloads.

Start dev server and initialize agents (will attempt to load small models):

# python -c "from ai_med_extract.app import create_app, initialize_agents; app=create_app(); initialize_agents(app, preload_small_models=True); app.run(host='0.0.0.0', port=7860)"

Environment flags of interest:

  • HF_SPACES=true — signals HF Spaces environment
  • PRELOAD_GGUF=true — will enable preloading GGUF in initialization (disabled by default)
  • HF_HOME, TORCH_HOME, WHISPER_CACHE — cache locations

Documentation and deployment (k8s, prometheus) should be added to this file when ready.