End-to-end ML inference for plant identification, medical entity extraction, chemical compound detection, and evidence-based Q&A — entirely local, entirely private.
Five-stage inference chain from photograph to evidence-backed botanical report.
Six components — five ML models and one safety gate script.
janjibDEV/vit-plantnet300k
Vision Transformer trained on the Pl@ntNet-300K dataset. Identifies approximately 14,000 plant species from photographs with high accuracy.
blaze999/Medical-NER
Extracts 41 medical entity types from text: medications, diseases, dosages, procedures, lab values, and more.
OpenMed/ChemicalDetect
Identifies active chemical compounds and molecular entities in botanical and pharmacological text descriptions.
microsoft/BioGPT-Large-PubMedQA
Large language model fine-tuned on PubMed literature. Answers yes/no/maybe questions about clinical evidence for herbal compounds.
d4data/biomedical-ner-all
General-purpose biomedical named entity recognition. Extracts diseases, chemicals, genes, species, and cell types from literature.
scripts/check_resources.py
The load-bearing rule. Every model download and every model load MUST pass through this gate. Returns green, yellow, or red based on available RAM and disk space.
Reference catalogue of key medicinal herbs supported by the pipeline.
How to invoke the pipeline via Claude Code, CLI scripts, or direct Python.
Ask Claude Code in natural language. The skill auto-discovers, gates, downloads, and runs the right model.
# Identify from a photo
"Identify this herb from my photo at ~/garden/IMG_4021.jpg"
# Look up medicinal properties
"What are the medical uses of stinging nettle?"
# Run full pipeline on a name
"Run the herb pipeline on Matricaria chamomilla"
# Evidence-based question
"Is there clinical evidence for valerian treating insomnia?"
Call the herb pipeline script directly for batch or automated processing.
# Full pipeline: identify + NER + evidence
.venv/bin/python3 scripts/herb_pipeline.py \
--image ~/photos/herb.jpg
# Pipeline from name (skip image classification)
.venv/bin/python3 scripts/herb_pipeline.py \
--name "Urtica dioica"
# Output as JSON
.venv/bin/python3 scripts/herb_pipeline.py \
--name "chamomile" --json
Each pipeline stage is a standalone script you can invoke independently.
# Search HuggingFace Hub
.venv/bin/python3 scripts/search.py "medical NER"
# Inspect a model's metadata
.venv/bin/python3 scripts/inspect.py blaze999/Medical-NER
# Gate check before download
.venv/bin/python3 scripts/check_resources.py --model-size 713
# Download a model
.venv/bin/python3 scripts/download.py blaze999/Medical-NER
# Run inference
.venv/bin/python3 scripts/run.py blaze999/Medical-NER \
--text "Nettle leaf extract 500mg daily"
Bootstrap the environment and run a smoke test.
# 1. Clone or enter the project
cd bacon-ai-huggingface
# 2. Run the installer (creates .venv, installs deps)
bash install.sh
# 3. Smoke test: medical NER demo
bash examples/medical_ner_demo.sh
# 4. Verify the venv
.venv/bin/python3 -c "import transformers; print('OK')"
Every download and every model load must pass through
scripts/check_resources.py first. The gate returns one of three verdicts:
GREEN (proceed),
YELLOW (warn, allow with caution), or
RED (halt, insufficient resources).
This rule is never bypassed without explicit user authorisation.