This release is a pre-release and may not be stable for production use.
cimhub_chat
Natural language chat interface for CIMHub power system models. Load any CIMHub-supported model (DSS, GLM, RAW, MATPOWER, CIM XML) and query or edit it in plain English.
Features
- Query — "How many loads are on bus 634?" / "What is the total MW?"
- Edit — "Change load L1 to 500 kW" / "Add a new line from 632 to 645"
- Cross-format awareness — "Show me the DSS command for this EnergyConsumer"
- Write-back — Saves edits to native format files or CIM XML
- Schema-aware — Introspects LinkML-generated dataclasses at runtime so the LLM knows valid field names, types, and relationships without hard-coded prompts
Usage
# Start the chat CLI with a DSS model
cimhub-chat ieee13/Master.dss
# Start with a PSS/E RAW model
cimhub-chat network.raw
# Start with a CIM XML file
cimhub-chat ieee13.xml --cim-profile cimhub_2026
Or from Python:
from cimhub_chat.cli import start_chat
start_chat("ieee13/Master.dss")
Architecture
CLI / REPL
↓
ModelService (loads + manages the active CIM model)
↓
Agent (LLM-backed reasoning loop via LangGraph)
↓
MCP Server (exposes CIM graph as tools via Model Context Protocol)
↓
CIMHub converters (cimhub_opendss, cimhub_raw, cimhub_gridlabd, ...)
The MCP server (mcp_server/) provides typed tools (list_buses, get_load, set_load_power, etc.) backed by runtime introspection of the loaded model's LinkML schema. The agent calls these tools rather than generating raw Python.
Supported LLMs
Configured via environment variables or --model flag:
| Provider | Models |
|---|---|
| Anthropic | claude-sonnet-5, claude-opus-4-8 |
| OpenAI | gpt-4o, gpt-4-turbo |
| Ollama | any locally-served model |
Running Tests
uv run pytest cimhub_chat/tests/ -v
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cimhub_chat-0.1.0a0.tar.gz.
File metadata
- Download URL: cimhub_chat-0.1.0a0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b7e439d14654ab6516f2a7c2a483fdf71732cd7ff66a33f011527b76d122c27
|
|
| MD5 |
68f518890b296fb47fc7c379a03d98fe
|
|
| BLAKE2b-256 |
885541ee5c904dde20a6a24c6820c38b189e18df900a0ebb655cf479f5b3c679
|
Provenance
The following attestation bundles were made for cimhub_chat-0.1.0a0.tar.gz:
Publisher:
publish-cimhub-chat.yml on PNNL-CIM-Tools/CIMHub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimhub_chat-0.1.0a0.tar.gz -
Subject digest:
4b7e439d14654ab6516f2a7c2a483fdf71732cd7ff66a33f011527b76d122c27 - Sigstore transparency entry: 2498862204
- Sigstore integration time:
-
Permalink:
PNNL-CIM-Tools/CIMHub@a52b64556614928077b56ad790c3dfceddde552f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/PNNL-CIM-Tools
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-cimhub-chat.yml@a52b64556614928077b56ad790c3dfceddde552f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cimhub_chat-0.1.0a0-py3-none-any.whl.
File metadata
- Download URL: cimhub_chat-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91ea94e6afdb6bda554dfc480649373a00a0ab848c63d5976b370113e8c72b96
|
|
| MD5 |
074f71edf455650b0bce67c58fe95933
|
|
| BLAKE2b-256 |
ac347ace8727c3049d48841e355ee2dc94ca7e83519dcf1121de7b24f0c267e0
|
Provenance
The following attestation bundles were made for cimhub_chat-0.1.0a0-py3-none-any.whl:
Publisher:
publish-cimhub-chat.yml on PNNL-CIM-Tools/CIMHub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimhub_chat-0.1.0a0-py3-none-any.whl -
Subject digest:
91ea94e6afdb6bda554dfc480649373a00a0ab848c63d5976b370113e8c72b96 - Sigstore transparency entry: 2498862223
- Sigstore integration time:
-
Permalink:
PNNL-CIM-Tools/CIMHub@a52b64556614928077b56ad790c3dfceddde552f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/PNNL-CIM-Tools
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-cimhub-chat.yml@a52b64556614928077b56ad790c3dfceddde552f -
Trigger Event:
workflow_dispatch
-
Statement type: