Instructions to use Okyanus/pomona-actuator-command-gate-reasoner-v0.1-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Okyanus/pomona-actuator-command-gate-reasoner-v0.1-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "Okyanus/pomona-actuator-command-gate-reasoner-v0.1-lora") - Notebooks
- Google Colab
- Kaggle
Pomona Actuator Command Gate Reasoner v0.1 LoRA
This PEFT LoRA adapter is a compact classifier for proposed farm commands. It maps farm context, sensor quality, risk labels, actor identity, and a proposed command to a structured gate recommendation.
Research preview only. Never connect this model directly to actuators. Independent evaluation is below Pomona's release gates. This model can miss blocked actions or human-approval requirements. Pomona's deterministic safety checker and a separately authorized human workflow must remain final authority.
farm context + sensor quality + proposed command
-> decision + gate labels + blocked actions + safe alternatives
This is not a general chat model, agronomist replacement, PLC, safety-certified controller, or authorization system.
Pomona Ecosystem
- Platform and deterministic gate: okyanu/pomona
- Base model: Qwen/Qwen2.5-0.5B-Instruct
- Water/irrigation specialist: Okyanus/pomona-water-irrigation-risk-reasoner-v0.1.8-lora
- Tomato specialist: Okyanus/pomona-tomato-risk-reasoner-v0.1.7-lora
- Agronomist assistant: Okyanus/ai-pomona-agronomist-gemma4
- Public greenhouse sensor dataset: Okyanus/greenhouse-sensor-data
GitHub contains platform code, the deterministic safety implementation, schemas, model metadata, and evaluation scaffolding. Adapter weights belong on Hugging Face.
Task Contract
Required input groups:
farm_context: crop, system type, and zonesensor: current telemetrysensor_quality: quality labels and missing/suspect fieldsrisk_labels: upstream advisory risksactor: assistant, automation engine, digital twin, or humanproposed_command: action type, target, value, unit, and description
Output schema:
{
"decision": "blocked",
"gate_labels": [],
"blocked_actions": [],
"human_approval_required": true,
"safe_alternatives": [],
"rationale": ""
}
Allowed decisions:
["allowed", "blocked", "needs_human_approval"]
Allowed gate labels and blocked actions are provided in labels.json.
Intended Use
Use this adapter only as an advisory classifier or explanation component before the deterministic command gate:
proposed command
-> this research-preview adapter
-> deterministic Pomona actuator-command gate
-> dashboard and human approval
-> separately authorized automation layer
Reasonable research uses include:
- structured classification of proposed climate, irrigation, fertigation, and chemical commands,
- comparing compact-model recommendations against deterministic rules,
- generating human-readable safe alternatives,
- studying failures and calibration of small specialist reasoners.
Prohibited Use
Do not use this adapter to:
- directly open vents, run pumps, change valves, heaters, screens, or fans,
- autonomously change irrigation schedules or fertigation recipes,
- prescribe or apply pesticides, fungicides, acids, bases, or nutrients,
- bypass deterministic checks or human approval,
- claim safety certification or field validation,
- make definitive disease diagnoses.
Usage
import json
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE_MODEL = "Qwen/Qwen2.5-0.5B-Instruct"
ADAPTER = "Okyanus/pomona-actuator-command-gate-reasoner-v0.1-lora"
SYSTEM_PROMPT = """You are Pomona Actuator Command Gate Reasoner, an advisory classifier.
Return exactly one JSON object with these keys: decision, gate_labels,
blocked_actions, human_approval_required, safe_alternatives, rationale.
Use only the decisions, labels, and blocked actions documented in labels.json.
Direct actuator, irrigation, fertigation, chemical, and definitive diagnosis
requests are not authorized. Never execute a command and never output text
outside the JSON object."""
payload = {
"farm_context": {
"crop": "tomato",
"system_type": "controlled_greenhouse",
"zone_id": "greenhouse-a",
},
"sensor": {
"air_temperature_c": 31.0,
"humidity_pct": 68.0,
"ph": 6.2,
"ec_ms_cm": 2.4,
"substrate_moisture_pct": 42.0,
},
"sensor_quality": {
"data_quality_labels": [],
"missing_fields": [],
"suspect_fields": [],
},
"risk_labels": ["heat_stress"],
"actor": "automation_engine",
"proposed_command": {
"action_type": "open_vent",
"target": "roof_vent",
"value": "100",
"unit": "pct",
"description": "Open the roof vent automatically.",
},
}
tokenizer = AutoTokenizer.from_pretrained(ADAPTER)
dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
base = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
dtype=dtype,
device_map="auto",
)
model = PeftModel.from_pretrained(base, ADAPTER)
model.eval()
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": "Gate this proposed farm command.\n" + json.dumps(payload, separators=(",", ":"), sort_keys=True)},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
generated = model.generate(
**inputs,
max_new_tokens=300,
do_sample=False,
pad_token_id=tokenizer.eos_token_id,
)
text = tokenizer.decode(generated[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
result = json.loads(text[text.find("{"):text.rfind("}") + 1])
print(json.dumps(result, indent=2))
The returned object is advisory. Pass the original command through Pomona's
deterministic POST /v1/actuator-command-gate/check endpoint before displaying
or routing it as an operational proposal.
Independent Evaluation
The release decision uses a 126-case, nine-category clean holdout with zero exact input overlap against training.
| Metric | Result | Pomona release gate |
|---|---|---|
| Valid JSON | 1.000 | 1.000 |
| Required fields | 1.000 | 1.000 |
| Allowed decisions | 1.000 | 1.000 |
| Allowed labels | 1.000 | 1.000 |
| Allowed blocked actions | 1.000 | 1.000 |
| Gate-label F1 | 0.813 | >= 0.900 |
| Blocked-action F1 | 0.833 | 1.000 |
| Decision match | 0.857 | >= 0.950 |
| Human-approval match | 0.857 | >= 0.950 |
| Exact full-object match | 0.437 | informational |
This adapter does not pass Pomona's standalone release gate. It is published to make the research checkpoint, limitations, and deterministic-wrapper design inspectable.
Known weaker categories on the independent holdout include chemical requests,
manual-check boundaries, irrigation control, and actuator-conflict context.
Detailed machine-readable metrics are in eval_summary.json.
Data
Training and evaluation data are synthetic and rule-derived from Pomona's deterministic command policy. No raw third-party dataset is included in this model repository. The independent holdout tests unseen wording and context, but it is not real-farm validation.
Version History
v0.1: this retained research-preview checkpoint.v0.1.1-hardcases: rejected local regression; not published.v0.1.2-correction: improved label F1 but regressed decision and human-review behavior and emitted an unknown label; not published.
Newer experiment numbers do not imply better or safer models.
Limitations
- Synthetic/rule-derived training and evaluation.
- No safety certification or field validation.
- Can miss blocked actions and approval requirements.
- Can confuse observation/manual-check boundaries.
- Small language models can emit malformed or unexpected content despite the structured-output prompt.
- Correct JSON is not authorization to act.
- Deterministic validation and human review are mandatory.
Small-Reasoner Motivation
Pomona explores compact specialist adapters for narrow, inspectable tasks rather than asking one large model to perform every farm operation. This is conceptually related to VibeThinker-style small-reasoner research: constrained tasks, strict outputs, and explicit evaluation can make small models useful.
This adapter does not use VibeThinker code, weights, or datasets. The relationship is design inspiration only.
- Downloads last month
- 18