Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pranavkrishnasuresh/chemAgent/llms.txt
Use this file to discover all available pages before exploring further.
Overview
ChemAgent provides aLOW_VRAM configuration flag to control whether the LlaSMol model is loaded. The LlaSMol model requires at least 15GB of VRAM to run properly.
Configuration File
The VRAM setting is controlled in:plan_execute_agent/config.py
VRAM Modes
Low VRAM Mode (Default)
Configuration:- LlaSMol model is NOT loaded (chem_tools.py:115-119)
answer_chemistry_querytool will raise a RuntimeError if called- Agent relies entirely on OpenAI GPT-4o for chemistry queries
- Suitable for systems with less than 15GB VRAM
LOW_VRAM = True, attempting to use the chemistry query tool will produce:
High VRAM Mode (Cluster/GPU)
Configuration:- Minimum 15GB VRAM
- CUDA-enabled GPU
- PyTorch with CUDA support
- LlaSMol model is loaded into GPU memory
answer_chemistry_querytool becomes available- Model uses
bfloat16precision for memory efficiency - Automatic device mapping with
device_map="auto"
Implementation Details
Conditional Loading
The VRAM flag controls model initialization inplan_execute_agent/chem_tools.py:
chem_tools.py:115-119
Runtime Checks
Theanswer_chemistry_query tool validates VRAM mode:
chem_tools.py:148-151
Model Memory Usage
When loaded, the LlaSMol model uses:Memory Optimizations
-
bfloat16 Precision (model.py:38, 45)
-
PEFT/LoRA Loading (model.py:42-46)
-
Model Merging (model.py:50)
-
Torch Compilation (model.py:58-59)
Device Selection
The model automatically detects available devices:model.py:10-16
Currently, CPU-only inference is not implemented. The model loader raises
NotImplementedError for CPU devices (model.py:48).Configuration for Different Environments
Local Development (Low VRAM)
plan_execute_agent/config.py
- Laptops with consumer GPUs (less than 15GB VRAM)
- Development machines with limited GPU memory
- Testing agent logic without model inference
Cluster/Production (High VRAM)
plan_execute_agent/config.py
- NVIDIA A100 (40GB/80GB)
- NVIDIA V100 (16GB/32GB)
- NVIDIA RTX 3090 (24GB)
- Cloud GPU instances with ≥15GB VRAM
Troubleshooting
Out of Memory Errors
If you encounter CUDA OOM errors:-
Verify VRAM availability:
-
Check available memory:
- Set LOW_VRAM = True if VRAM < 15GB
Model Not Loading
If the model fails to load:Related Configuration
The sameLOW_VRAM flag exists in:
plan_execute_agent/config.py:2(active flag)LLM4Chem/config.py:2(legacy, not actively used)
Next Steps
Model Selection
Choose which LlaSMol model to use
Environment Setup
Configure API keys and environment variables