Instructions to use ghzlmc/foamgpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ghzlmc/foamgpt with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
FoamGPT adapters
LoRA adapters that let one open-weight model serve every LLM call of an end-to-end OpenFOAM agent: planning the case, writing the configuration files, diagnosing solver errors, and repairing the case. They accompany the paper FoamGPT: Fine-Tuning Large Language Models for Agentic Automation of CFD Simulations with OpenFOAM (anonymous submission). Code, data, and evaluation scripts are in the companion code repository.
Adapters
| Folder | Base model | Training records | In the paper |
|---|---|---|---|
nemotron-3-nano-30b/shared/ |
nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16 |
2,500 (all nine call sites) | FoamGPT-Nemotron (Table 1) |
gemma4-26b-a4b/shared/ |
unsloth/gemma-4-26b-a4b-it |
2,499 (all nine call sites) | FoamGPT-Gemma4 (Table 1) |
nemotron-3-nano-30b/split/stage-specific/{plan,write,review}/ |
Nemotron | the records of each group | stage-specific split C (Appendix B) |
nemotron-3-nano-30b/split/random-R{1,2,3}/G{1,2,3}/ |
Nemotron | the records of each group | random splits R1-R3 (Appendix B) |
nemotron-3-nano-30b/scaling/{L025,L050,L075,L100}/ |
Nemotron | 560 / 1,314 / 1,874 / 2,500 | data-scaling curve (Figure 4) |
The shared adapters are the systems reported as FoamGPT. Records are teacher completions from variants 1-7 of the FoamBench Basic families; records longer than 16,384 tokens after chat templating are dropped (147 error_analysis records with the Nemotron tokenizer, 148 with the Gemma4 tokenizer). The manifests of trained records are in the code repository.
Which split adapter serves which call site
| Call site | stage-specific | R1 | R2 | R3 |
|---|---|---|---|---|
parse_case_info |
plan | G1 | G1 | G3 |
build_advice |
plan | G1 | G2 | G1 |
decompose_subtasks |
plan | G3 | G2 | G1 |
generate_file |
write | G2 | G2 | G2 |
allrun_commands |
write | G2 | G1 | G3 |
allrun_script |
write | G1 | G3 | G2 |
error_analysis |
review | G3 | G1 | G2 |
rewrite_plan |
review | G2 | G2 | G2 |
rewrite_files |
write | G2 | G3 | G1 |
Training
Supervised fine-tuning on the teacher's completions (loss on completion tokens only), 3 epochs, learning rate 2e-4 with a cosine schedule (0.1 minimum-rate floor), warmup ratio 0.05, effective batch 16, weight decay 0.01, seed 3407, maximum length 16,384 tokens, thinking disabled.
- Nemotron adapters: LoRA r = 16, alpha = 32, dropout 0, on
q/k/v/o_proj,gate/up/down_proj, and the Mambain/out_proj. TRL 0.24.0, Transformers 4.56.2, PEFT 0.18.1, PyTorch 2.7.1. - Gemma4 adapter: LoRA r = 16, alpha = 16, dropout 0, on the language-tower attention and feed-forward linears, trained through Unsloth. TRL 0.24.0, Transformers 5.5.0, PEFT 0.19.1, PyTorch 2.10.0.
Use
Each folder holds adapter_model.safetensors, adapter_config.json, and the tokenizer files and chat_template.jinja the adapter was trained and served with. Example with vLLM:
vllm serve nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16 \
--enable-lora --max-lora-rank 16 --lora-modules foamgpt=./nemotron-3-nano-30b/shared \
--chat-template ./nemotron-3-nano-30b/shared/chat_template.jinja \
--tensor-parallel-size 4 --max-model-len 100000
The paper's runs use temperature 0.6, a 16,384-token output cap, and the agent harness from the code repository. For Gemma4 the adapter was merged into the bfloat16 base model for serving (PEFT merge_and_unload).
License and terms
See LICENSE.md. The Nemotron adapters are distributed under the NVIDIA Nemotron Open Model License and the Gemma4 adapter under Apache-2.0, following their base models. The training data are outputs of Claude Opus 4.6 obtained through Amazon Bedrock and are subject to Anthropic's terms of service and usage policy. The adapters are released as research artifacts for research use.
- Downloads last month
- -
Model tree for ghzlmc/foamgpt
Base model
nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16