BACON-AI · HuggingFace Expert Skill

The Botanical Intelligence Pipeline

Identify garden & forest herbs from photos, extract their medicinal properties, and query clinical evidence — all running locally on your machine. No data leaves your device.

6 ML Models
14k Plant Species
41 Entity Types
100% Local & Private
01

The Pipeline

Three AI models chained together: photo identification, medical entity extraction, and evidence-based verification.

Concept Architecture
📷
Photo Input
Garden herb photo
or plant name
🌿
Plant ID
PlantNet ViT
14k species
344 MB
Medical NER
Entity extraction
41 entity types
713 MB
📚
BioGPT QA
PubMed evidence
yes / no / maybe
6.3 GB
Results
Species + remedies
+ evidence verdict
BPMN 2.0 Process Diagram
Herb Expert Pipeline User Input Model Inference Resource Gate Start X Image? Identify Plant PlantNet ViT yes Enter Plant Name --plant "name" no check_resources.py ⚠ SAFETY GATE KB Lookup HERB_KNOWLEDGE{} Medical NER blaze999/Medical-NER check_resources.py green / yellow / red ? condition? BioGPT Evidence PubMedQA (6.3 GB) yes no condition Output
Task Gateway / Safety Gate Sequence Flow Resource Check
02

The Models

Six specialised models, each excelling at one task. All run locally on CPU — no GPU required.

Vision 344 MB

PlantNet ViT

janjibDEV/vit-plantnet300k

Identifies ~14,000 plant species from photos. Trained on PlantNet300K dataset with Vision Transformer architecture.

✓ Apache-2.0 ✓ image-classification
NER 713 MB

Medical NER

blaze999/Medical-NER

DeBERTa-v3 fine-tuned on PubMed for 41 medical entity types: medications, diseases, dosages, procedures, anatomy.

✓ MIT ✓ token-classification
Chemistry 290 MB

ChemicalDetect

OpenMed/OpenMed-NER-ChemicalDetect-ModernMed-149M

ModernBERT for chemical entity recognition. Identifies compounds, active ingredients, and botanical chemicals.

✓ Apache-2.0 ✓ token-classification
QA 6.3 GB

BioGPT PubMedQA

microsoft/BioGPT-Large-PubMedQA

Microsoft’s generative biomedical LM. 78% accuracy on PubMedQA. Answers yes/no/maybe on clinical evidence questions.

✓ MIT ✓ text-generation
NER 508 MB

Biomedical NER

d4data/biomedical-ner-all

DistilBERT trained on Maccrobat corpus. 107 biomedical entity types. Best for clinical text with pharmaceutical focus.

✓ Apache-2.0 ✓ token-classification
Safety Script

Resource Gate

scripts/check_resources.py

The load-bearing rule. Every download and every model load passes through this gate. Returns green / yellow / red.

⚠ Never bypassed ✓ RAM + VRAM + Disk
03

Herb Index

Garden and forest herbs in the knowledge base, with traditional uses and active compounds.

🌿

Stinging Nettle

Urtica dioica
Parts: leaves, root

BPH/prostate support, allergies, arthritis, anaemia

beta-sitosterol, scopoletin, lignans, polysaccharides, silicic acid
🌼

Chamomile

Matricaria chamomilla
Parts: flowers

Sleep aid, digestive upset, anxiety, skin inflammation

apigenin, bisabolol, chamazulene, flavonoids

Dandelion

Taraxacum officinale
Parts: leaves, root, flowers

Liver support, diuretic, digestive bitter, blood sugar regulation

taraxasterol, chicoric acid, inulin, potassium
🍇

Elderberry

Sambucus nigra
Parts: berries, flowers

Cold and flu, immune support, sinus congestion

anthocyanins, flavonoids, vitamin C, phenolic acids
🌾

Valerian

Valeriana officinalis
Parts: root

Insomnia, anxiety, muscle relaxation

valerenic acid, isovaleric acid, iridoids, GABA

St John’s Wort

Hypericum perforatum
Parts: flowering tops

Mild-moderate depression, nerve pain, wound healing

hypericin, hyperforin, flavonoids, tannins
🍃

Yarrow

Achillea millefolium
Parts: leaves, flowers

Wound healing, fever, digestive aid, menstrual cramps

achillein, azulene, flavonoids, salicylic acid
🍂

Plantain

Plantago major
Parts: leaves

Wound poultice, insect bites, cough, urinary tract

aucubin, allantoin, mucilage, tannins

Hawthorn

Crataegus monogyna
Parts: berries, leaves, flowers

Heart health, blood pressure, anxiety, digestion

OPCs, vitexin, hyperoside, flavonoids
🌴

Saw Palmetto

Serenoa repens
Parts: berries

BPH/prostate health, urinary flow, hormonal balance

fatty acids, phytosterols, beta-sitosterol
04

Usage Guide

Two ways to use the pipeline: ask Claude naturally, or run the scripts directly.

Via Claude Code

Just ask naturally. The huggingface-expert skill triggers automatically:

Claude Code prompt
# Identify a herb from a photo
"What plant is in this photo and what are its medicinal uses?"

# Look up a specific herb
"What are the medicinal properties of stinging nettle for prostate health?"

# Search for a model
"Find me a model that can classify medicinal plants"

# Run NER on clinical text
"Extract entities from: Patient taking saw palmetto 320mg daily"

Herb Pipeline (Direct)

The herb_pipeline.py script chains all three models:

Terminal
PY=~/.claude/skills/huggingface-expert/.venv/bin/python3

# List all herbs in knowledge base
$PY scripts/herb_pipeline.py --list

# Look up a herb
$PY scripts/herb_pipeline.py --plant "chamomile"

# Look up a herb for a specific condition
$PY scripts/herb_pipeline.py \
  --plant "stinging nettle" \
  --condition "prostate enlargement"

# Identify from a photo + get remedies
$PY scripts/herb_pipeline.py \
  --image ~/photos/garden_herb.jpg

# JSON output for scripting
$PY scripts/herb_pipeline.py \
  --plant "elderberry" \
  --condition "cold and flu" --json

Individual Scripts

The core skill scripts for the full HuggingFace pipeline:

Terminal
PY=~/.claude/skills/huggingface-expert/.venv/bin/python3

# 1. Search HuggingFace Hub
$PY scripts/search.py \
  --task token-classification \
  --query "biomedical NER" --limit 5 --json

# 2. Inspect a model
$PY scripts/inspect.py \
  --model blaze999/Medical-NER --json

# 3. Safety gate (MANDATORY)
$PY scripts/check_resources.py \
  --model blaze999/Medical-NER --json

# 4. Download
$PY scripts/download.py \
  --model blaze999/Medical-NER --json

# 5. Run inference
$PY scripts/run.py \
  --model blaze999/Medical-NER \
  --input "Patient taking green tea extract" --json

Installation

One-time setup. The skill bootstraps its own Python environment:

Terminal
# Clone or extract the skill
cd ~/.claude/skills/huggingface-expert

# Bootstrap the venv (CPU-only PyTorch)
bash install.sh

# Smoke test (downloads a small model)
bash examples/medical_ner_demo.sh

# Check what's cached locally
ls ~/.cache/huggingface/hub/models--*

The Resource Gate

Every download and every model load is gated by check_resources.py. This is the load-bearing rule of the skill. It compares projected RAM/VRAM/disk usage against free resources and returns green, yellow, or red. On red, the pipeline refuses to proceed. Never bypass without explicit user authorization.