Loading and scoring
Use a CUDA GPU with BF16 support. The original run used PyTorch 2.8.0 with CUDA 12.8. Install an appropriate CUDA build of PyTorch, then the remaining pinned requirements. The helper processes fields individually and preserves the training prompt and probability calculation.
hf download bespokelabs/Bespoke-Nimble-9B --local-dir nimble-model
pip install -r nimble-model/requirements.txt
Authenticate with a Hugging Face token that can read this repository if it is private. Review the included helper before importing it; no trust_remote_code=True is required.
import sys
sys.path.insert(0, "nimble-model")
from inference import NimbleModel
model = NimbleModel("nimble-model")
result = model.score(
context="The store accepts returns within 30 days. This item was bought 12 days ago.",
schema={
"eligible": {
"type": "boolean",
"description": "Is this item within the store return window?"
}
},
)
print(result["output"])
print(result["fields"]["eligible"]["probabilities"])
For choices, use type="enum", a choices list of strings, a description, and optional choice_descriptions. For rubric scores, use integer-valued enum strings such as ["0", "1", "2"], describe each level, and pass that field name in score_fields=["quality"]. This returns the selected integer and its probability-weighted expected score. Each field supports at most 26 choices. Prompts exceeding 2,048 tokens are rejected rather than truncated.