Instructions to use PromptExecutionAU/wattson-granite-4.2-8b-py with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PromptExecutionAU/wattson-granite-4.2-8b-py with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PromptExecutionAU/wattson-granite-4.2-8b-py") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PromptExecutionAU/wattson-granite-4.2-8b-py") model = AutoModelForCausalLM.from_pretrained("PromptExecutionAU/wattson-granite-4.2-8b-py", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PromptExecutionAU/wattson-granite-4.2-8b-py with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PromptExecutionAU/wattson-granite-4.2-8b-py" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PromptExecutionAU/wattson-granite-4.2-8b-py", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PromptExecutionAU/wattson-granite-4.2-8b-py
- SGLang
How to use PromptExecutionAU/wattson-granite-4.2-8b-py with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "PromptExecutionAU/wattson-granite-4.2-8b-py" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PromptExecutionAU/wattson-granite-4.2-8b-py", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "PromptExecutionAU/wattson-granite-4.2-8b-py" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PromptExecutionAU/wattson-granite-4.2-8b-py", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PromptExecutionAU/wattson-granite-4.2-8b-py with Docker Model Runner:
docker model run hf.co/PromptExecutionAU/wattson-granite-4.2-8b-py
wattson-granite-4.2-8b-py
Granite 4.2 8B fine-tuned (LoRA, merged to bf16) to answer AC power-flow questions about transmission networks by writing Python that calls a solver, and never computing numbers itself. Part of WattsOn / wattson.
What it does
It is given a run_python tool (a restricted Python shell with a solver module: solver.trial(...) runs a pandapower AC power
flow, solver.exists(...) checks that a line or bus exists) and tasks such as fitting a load scale to a voltage target, reporting
an N-1 contingency, choosing the worst of several outages, or refusing a task that names an element that does not exist.
Evaluation (held-out networks, one seed)
| Suite | Result |
|---|---|
| Held-out fits and reports (90) | 90 of 90 |
| Smoke (20) | 20 of 20 |
| Judgement: worst outage (40) | 36 of 40 |
| Unsolvable: must refuse (28) | 14 of 28 |
| Planning: multi-candidate (40) | 40 of 40 |
| Held-out attempts containing a number no tool or prompt gave the model | 0 of 90 |
| Derived-arithmetic suite (40) | 37 of 40 |
| Derived-suite attempts containing a number no tool or prompt gave the model | 0 of 40 (the exposure measure flags 1: the model computed a mean in Python, printed mean88.69, and copied it; the measure does not read a number glued to a word, so that flag is an artifact) |
One training seed. The Qwen3.5-4B students of the same recipe vary by up to 9 tasks between seeds on the unsolvable suite, so
the unsolvable score here should not be read as stable. Full tables and limits: docs/results.md in the repository.
Training
- Base:
ibm-granite/granite-4.2-8bat revisionb3791992239dce12d0038f1f54a8adb7b02d59ab(Apache-2.0). - Data: 826 oracle-scripted trajectories (the programs, tool replies and answers are produced by a deterministic script that runs the real solver; no model-generated text). Networks: CSIRO Synthetic-NEM-2000-Bus (CC BY 4.0, CSIRO) and pandapower cases. Held-out evaluation networks are not in the training rows.
- LoRA r=32, alpha=64, all attention and MLP projections; 2 epochs; learning rate 1e-4 cosine; sequence length 8192; seed 42.
- Weight integrity: SHA-256 of every file is listed in
hash_manifest.jsonin this repository.
Intended use and limits
- For the WattsOn evaluation harness and research on tool-grounded numerical reasoning. It is not a power-system engineering tool and its answers must not be used for operational decisions.
- The Python shell it calls is not a security boundary: it is a restricted
python -Ichild with a module allowlist, a wall-clock limit and a memory limit. Do not expose it to untrusted input. - Evaluated on AC power flow only, on a handful of networks. Refusal of non-existent elements is the weakest behaviour.
- Downloads last month
- 331