low-resource-ai-researcher
Train high-performance medical LLMs on consumer GPUs using parameter-efficient fine-tuning
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aipoch-ai/low-resource-ai-researcherSkill: Low-Resource AI Researcher
ID: 215
Category: AI/ML Research
Language: Python
Framework: PyTorch + PEFT (LoRA/QLoRA) + Transformers
Overview
Based on Parameter-Efficient Fine-Tuning (PEFT) technology, trains high-performance medical domain large language models on consumer-grade GPUs or single A100. Supports advanced fine-tuning methods such as LoRA, QLoRA, optimized for medical text understanding and generation tasks.
Features
- 🚀 Parameter-Efficient Fine-Tuning: LoRA, QLoRA, DoRA support
- 🏥 Medical Domain Optimized: Pre-configured for medical QA, diagnosis, clinical notes
- 💻 Low-Resource Ready: Optimized for consumer GPUs (RTX 3090/4090) and single A100
- 📊 Quantization: 4-bit/8-bit quantization with bitsandbytes
- 🔄 Multi-Task: Supports SFT, DPO, and medical instruction tuning
- 📝 Medical Datasets: Built-in support for PubMedQA, MedQA, MIMIC-III
Installation
# Core dependencies
pip install torch transformers datasets accelerate peft bitsandbytes
# Optional for training optimization
pip install flash-attn --no-build-isolation
pip install wandb tensorboard
# Medical NLP utilities
pip install scispacy scikit-learn
Quick Start
from skills.low_resource_ai_researcher.scripts.main import MedicalPEFTTrainer
# Initialize trainer
trainer = MedicalPEFTTrainer(
model_name="meta-llama/Llama-2-7b-hf",
task="medical_qa"
)
# Train with LoRA
trainer.train(
output_dir="./medical_lora_model",
num_epochs=3,
batch_size=4,
use_qlora=True # 4-bit quantization
)
Configuration
Hardware Profiles
| Profile | GPU Memory | Quantization | Max Model Size | Batch Size |
|---|---|---|---|---|
| consumer-24g | 24GB (RTX 3090/4090) | QLoRA 4-bit | 70B | 1-2 |
| a100-40g | 40GB (A100) | LoRA 8-bit | 70B | 4-8 |
| a100-80g | 80GB (A100) | LoRA 16-bit | 70B | 8-16 |
| multi-gpu | 2x A100 | LoRA 16-bit | 70B+ | 16+ |
LoRA Config
lora:
r: 64 # LoRA rank
lora_alpha: 128 # Scaling factor
target_modules: # Modules to apply LoRA
- q_proj
- v_proj
- k_proj
- o_proj
- gate_proj
- up_proj
- down_proj
lora_dropout: 0.05
bias: "none"
task_type: "CAUSAL_LM"
CLI Usage
# Basic training
python scripts/main.py \
--model_name_or_path meta-llama/Llama-2-7b-hf \
--dataset medical_qa \
--output_dir ./output \
--use_qlora \
--per_device_train_batch_size 4
# With custom config
python scripts/main.py --config configs/medical_qlora.yaml
# Resume training
python scripts/main.py --resume_from_checkpoint ./output/checkpoint-1000
API Reference
MedicalPEFTTrainer
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aipoch-ai-low-resource-ai-researcher": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
mechanism-flowchart
Generates Mermaid flowchart code and visual diagrams for pathophysiological.
reference-style-sync
One-click synchronization and standardization of reference formats in literature management tools, intelligently fixing metadata errors.
metagenomic-krona-chart
Analyze data with `metagenomic-krona-chart` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.
pptx-posters
Generate PowerPoint presentations and academic posters from paper abstracts or full paper content, with automatic layout optimization and citation formatting.
anatomy-quiz-master
Generate interactive anatomy quizzes for medical education with multiple question types, difficulty levels, and anatomical regions. Supports gross anatomy, neuroanatomy, and clinical correlations for self-assessment and exam preparation.