# gridfm-graphkit
[](https://gridfm.github.io/gridfm-graphkit/)



This library is brought to you by the GridFM team to train, finetune and interact with a foundation model for the electric power grid.
---
<p align="center">
<img src="https://raw.githubusercontent.com/gridfm/gridfm-graphkit/refs/heads/main/docs/figs/pre_training.png" alt="GridFM logo"/>
<br/>
</p>
# Installation
You can install `gridfm-graphkit` directly from PyPI:
```bash
pip install gridfm-graphkit
```
To contribute or develop locally, clone the repository and install in editable mode:
```bash
git clone git@github.com:gridfm/gridfm-graphkit.git
cd gridfm-graphkit
python -m venv venv
source venv/bin/activate
pip install -e .
```
For documentation generation and unit testing, install with the optional `dev` and `test` extras:
```bash
pip install -e .[dev,test]
```
# CLI commands
An interface to train, fine-tune, and evaluate GridFM models using configurable YAML files and MLflow tracking.
```bash
gridfm_graphkit <command> [OPTIONS]
```
Available commands:
* `train` – Train a new model from scrathc
* `finetune` – Fine-tune an existing pre-trained model
* `evaluate` – Evaluate model performance on a dataset
* `predict` – Run inference and save predictions
---
## Training Models
```bash
gridfm_graphkit train --config path/to/config.yaml
```
### Arguments
| Argument | Type | Description | Default |
| ---------------- | ------ | ---------------------------------------------------------------- | ------- |
| `--config` | `str` | **Required**. Path to the training configuration YAML file. | `None` |
| `--exp_name` | `str` | **Optional**. MLflow experiment name. | `timestamp` |
| `--run_name` | `str` | **Optional**. MLflow run name. | `run` |
| `--log_dir ` | `str` | **Optional**. MLflow logging directory. | `mlruns` |
| `--data_path` | `str` | **Optional**. Root dataset directory. | `data` |
### Examples
**Standard Training:**
```bash
gridfm_graphkit train --config examples/config/case30_ieee_base.yaml --data_path examples/data
```
---
## Fine-Tuning Models
```bash
gridfm_graphkit finetune --config path/to/config.yaml --model_path path/to/model.pth
```
### Arguments
| Argument | Type | Description | Default |
| -------------- | ----- | ----------------------------------------------- | --------- |
| `--config` | `str` | **Required**. Fine-tuning configuration file. | `None` |
| `--model_path` | `str` | **Required**. Path to a pre-trained model file. | `None` |
| `--exp_name` | `str` | MLflow experiment name. | timestamp |
| `--run_name` | `str` | MLflow run name. | `run` |
| `--log_dir` | `str` | MLflow logging directory. | `mlruns` |
| `--data_path` | `str` | Root dataset directory. | `data` |
---
## Evaluating Models
```bash
gridfm_graphkit evaluate --config path/to/eval.yaml --model_path path/to/model.pth
```
### Arguments
| Argument | Type | Description | Default |
| -------------- | ----- | ---------------------------------------- | --------- |
| `--config` | `str` | **Required**. Path to evaluation config. | `None` |
| `--model_path` | `str` | Path to the trained model file. | `None` |
| `--exp_name` | `str` | MLflow experiment name. | timestamp |
| `--run_name` | `str` | MLflow run name. | `run` |
| `--log_dir` | `str` | MLflow logging directory. | `mlruns` |
| `--data_path` | `str` | Dataset directory. | `data` |
---
## Running Predictions
```bash
gridfm_graphkit predict --config path/to/config.yaml --model_path path/to/model.pth
```
### Arguments
| Argument | Type | Description | Default |
| --------------- | ----- | --------------------------------------------- | --------- |
| `--config` | `str` | **Required**. Path to prediction config file. | `None` |
| `--model_path` | `str` | Path to the trained model file. | `None` |
| `--exp_name` | `str` | MLflow experiment name. | timestamp |
| `--run_name` | `str` | MLflow run name. | `run` |
| `--log_dir` | `str` | MLflow logging directory. | `mlruns` |
| `--data_path` | `str` | Dataset directory. | `data` |
| `--output_path` | `str` | Directory where predictions are saved. | `data` |
---
Raw data
{
"_id": null,
"home_page": null,
"name": "gridfm-graphkit",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": "Matteo Mazzonelli <matteo.mazzonelli1@ibm.com>",
"keywords": "electric power grid, foundational model, graph neural networks",
"author": null,
"author_email": "Matteo Mazzonelli <matteo.mazzonelli1@ibm.com>, Alban Puech <apuech@seas.harvard.edu>, Tamara Govindasamy <tamara.govindasamy@ibm.com>, Mangaliso Mngomezulu <mngomezulum@ibm.com>, Etienne Vos <etienne.vos@ibm.com>, Celia Cintas <celia.cintas@ibm.com>, Jonas Weiss <jwe@zurich.ibm.com>",
"download_url": "https://files.pythonhosted.org/packages/b6/cc/11ee2f50d6cf1095e6fafc5e0143f7cc7e4a1aac91a20345ad1e6ba06d52/gridfm_graphkit-0.0.4.tar.gz",
"platform": null,
"description": "# gridfm-graphkit\n[](https://gridfm.github.io/gridfm-graphkit/)\n\n\n\n\nThis library is brought to you by the GridFM team to train, finetune and interact with a foundation model for the electric power grid.\n\n---\n\n<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/gridfm/gridfm-graphkit/refs/heads/main/docs/figs/pre_training.png\" alt=\"GridFM logo\"/>\n <br/>\n</p>\n\n# Installation\n\nYou can install `gridfm-graphkit` directly from PyPI:\n\n```bash\npip install gridfm-graphkit\n```\n\nTo contribute or develop locally, clone the repository and install in editable mode:\n\n```bash\ngit clone git@github.com:gridfm/gridfm-graphkit.git\ncd gridfm-graphkit\npython -m venv venv\nsource venv/bin/activate\npip install -e .\n```\n\nFor documentation generation and unit testing, install with the optional `dev` and `test` extras:\n\n```bash\npip install -e .[dev,test]\n```\n\n\n# CLI commands\n\nAn interface to train, fine-tune, and evaluate GridFM models using configurable YAML files and MLflow tracking.\n\n```bash\ngridfm_graphkit <command> [OPTIONS]\n```\n\nAvailable commands:\n\n* `train` \u2013 Train a new model from scrathc\n* `finetune` \u2013 Fine-tune an existing pre-trained model\n* `evaluate` \u2013 Evaluate model performance on a dataset\n* `predict` \u2013 Run inference and save predictions\n\n---\n\n## Training Models\n\n```bash\ngridfm_graphkit train --config path/to/config.yaml\n```\n\n### Arguments\n\n| Argument | Type | Description | Default |\n| ---------------- | ------ | ---------------------------------------------------------------- | ------- |\n| `--config` | `str` | **Required**. Path to the training configuration YAML file. | `None` |\n| `--exp_name` | `str` | **Optional**. MLflow experiment name. | `timestamp` |\n| `--run_name` | `str` | **Optional**. MLflow run name. | `run` |\n| `--log_dir ` | `str` | **Optional**. MLflow logging directory. | `mlruns` |\n| `--data_path` | `str` | **Optional**. Root dataset directory. | `data` |\n\n### Examples\n\n**Standard Training:**\n\n```bash\ngridfm_graphkit train --config examples/config/case30_ieee_base.yaml --data_path examples/data\n```\n\n---\n\n## Fine-Tuning Models\n\n```bash\ngridfm_graphkit finetune --config path/to/config.yaml --model_path path/to/model.pth\n```\n\n### Arguments\n\n| Argument | Type | Description | Default |\n| -------------- | ----- | ----------------------------------------------- | --------- |\n| `--config` | `str` | **Required**. Fine-tuning configuration file. | `None` |\n| `--model_path` | `str` | **Required**. Path to a pre-trained model file. | `None` |\n| `--exp_name` | `str` | MLflow experiment name. | timestamp |\n| `--run_name` | `str` | MLflow run name. | `run` |\n| `--log_dir` | `str` | MLflow logging directory. | `mlruns` |\n| `--data_path` | `str` | Root dataset directory. | `data` |\n\n\n---\n\n## Evaluating Models\n\n```bash\ngridfm_graphkit evaluate --config path/to/eval.yaml --model_path path/to/model.pth\n```\n\n### Arguments\n\n| Argument | Type | Description | Default |\n| -------------- | ----- | ---------------------------------------- | --------- |\n| `--config` | `str` | **Required**. Path to evaluation config. | `None` |\n| `--model_path` | `str` | Path to the trained model file. | `None` |\n| `--exp_name` | `str` | MLflow experiment name. | timestamp |\n| `--run_name` | `str` | MLflow run name. | `run` |\n| `--log_dir` | `str` | MLflow logging directory. | `mlruns` |\n| `--data_path` | `str` | Dataset directory. | `data` |\n\n---\n\n## Running Predictions\n\n```bash\ngridfm_graphkit predict --config path/to/config.yaml --model_path path/to/model.pth\n```\n\n### Arguments\n\n| Argument | Type | Description | Default |\n| --------------- | ----- | --------------------------------------------- | --------- |\n| `--config` | `str` | **Required**. Path to prediction config file. | `None` |\n| `--model_path` | `str` | Path to the trained model file. | `None` |\n| `--exp_name` | `str` | MLflow experiment name. | timestamp |\n| `--run_name` | `str` | MLflow run name. | `run` |\n| `--log_dir` | `str` | MLflow logging directory. | `mlruns` |\n| `--data_path` | `str` | Dataset directory. | `data` |\n| `--output_path` | `str` | Directory where predictions are saved. | `data` |\n\n---\n",
"bugtrack_url": null,
"license": null,
"summary": "Grid Foundation Model",
"version": "0.0.4",
"project_urls": null,
"split_keywords": [
"electric power grid",
" foundational model",
" graph neural networks"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7f51968bc31eeda68c99822e25a2a15cd214227afa8e4bfefaf5cf8416a7c3c4",
"md5": "aa4f2cc275f76b2ca6c911eaa68a9598",
"sha256": "34fd940db554ad0bda2761538c40d964d36da6064e304e43e6e66c924c133665"
},
"downloads": -1,
"filename": "gridfm_graphkit-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aa4f2cc275f76b2ca6c911eaa68a9598",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 34539,
"upload_time": "2025-08-22T11:28:55",
"upload_time_iso_8601": "2025-08-22T11:28:55.136544Z",
"url": "https://files.pythonhosted.org/packages/7f/51/968bc31eeda68c99822e25a2a15cd214227afa8e4bfefaf5cf8416a7c3c4/gridfm_graphkit-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b6cc11ee2f50d6cf1095e6fafc5e0143f7cc7e4a1aac91a20345ad1e6ba06d52",
"md5": "047235d53c71dad4e4ab4ff976b539b1",
"sha256": "135cf34ca72bbb37a42a3ed0b0960595d71888c268d4138032814de07a77fc65"
},
"downloads": -1,
"filename": "gridfm_graphkit-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "047235d53c71dad4e4ab4ff976b539b1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 32394,
"upload_time": "2025-08-22T11:28:56",
"upload_time_iso_8601": "2025-08-22T11:28:56.564028Z",
"url": "https://files.pythonhosted.org/packages/b6/cc/11ee2f50d6cf1095e6fafc5e0143f7cc7e4a1aac91a20345ad1e6ba06d52/gridfm_graphkit-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-22 11:28:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "gridfm-graphkit"
}