Qwen-Powered On-Chain Agent: How REGLO Uses LLMs to Make Solar Scheduling Decisions

REGLO Agent lets Qwen pick the optimal scheduling window while crypto verifies it—LLM errors cost efficiency, not money.
REGLO Agent is an AI Agent built for the Monad Metropolis hackathon that uses UK solar curtailment and electricity price data to find the best time slots for deferring compute tasks. Qwen, called via DashScope's OpenAI-compatible interface, selects the optimal schedule from candidate windows and provides a verifiable natural language explanation. The architecture separates the LLM's choice authority from fund verification: the contract and oracle never read the model's wording, independently re-deriving costs from real data before triggering payment. Built-in honesty checks compare Qwen's choice against the deterministic optimum each run. A real on-chain payment has been completed on the Monad testnet, with Kimi and local Ollama fallbacks supported.
When an AI Agent has to make on-chain decisions that affect real money, what role should a large model actually play? The answer from REGLO Agent is quite illuminating: let the LLM handle "choosing," and let cryptography handle "verifying."
This AI Agent, built for the Monad Metropolis hackathon, automatically schedules compute tasks to avoid solar curtailment windows, and earns MON token rewards after proving cost savings on-chain. Within this decision chain, Qwen takes on the reasoning task of picking the optimal time slot from dozens of candidate windows.

Qwen's Specific Role in the Decision Chain
REGLO Agent's core task is to find the best time slots for deferring compute tasks, using real solar curtailment and electricity price data. This data comes from REGLO—a real-time curtailment monitoring platform covering four solar sites in the UK.
The decision logic is concentrated in the agent/reason.js file, which calls Qwen through DashScope's OpenAI-compatible chat-completions interface. Simply set REASONING_PROVIDER=qwen, and all decisions in that run will go through Qwen.
Qwen's inputs include the full list of candidate windows—site, hour, curtailment risk, electricity price—and it returns a selection along with a natural language explanation. In one real run, Qwen explained its choice this way: "The 13:00 slot has the lowest electricity price, and all sites have the same curtailment risk, making it the cheapest available option." This reasoning can be checked against the raw data in seconds, rather than being a black box.
Solar Curtailment refers to the practice where grid operators, when solar generation exceeds immediate demand or transmission capacity, actively ask photovoltaic plants to reduce output or even temporarily shut down some units. The curtailed generation is essentially "wasted clean energy," so if you can predict curtailment windows and move deferrable compute tasks to other time slots, or "absorb" that surplus electricity during curtailment periods, you can earn economic or credit-based rewards. The REGLO platform monitors the real-time curtailment status and electricity prices of four UK solar sites, providing a real data foundation for such scheduling decisions. Understanding "curtailment windows" is the prerequisite for understanding the Agent's overall task objective: it's not randomly picking times, but finding the lowest-cost execution window under real energy supply-demand constraints.
DashScope's OpenAI-compatible chat-completions interface refers to the inference service provided by Alibaba Cloud Bailian (DashScope) for the Qwen model family, which exposes a request format identical to OpenAI's /v1/chat/completions interface. This means any code already written for the OpenAI SDK or format only needs its base URL and API Key swapped to DashScope's to call Qwen directly, without rewriting business logic. This compatibility layer greatly reduces the cost of replacing closed-source models with Qwen, and is one reason REGLO Agent can switch between different reasoning backends with just a REASONING_PROVIDER environment variable.
Explainability and Honesty Checks
The value Qwen brings shows up on two specific levels.
Explainability is the first. The contract and oracle never read the LLM's wording; they independently verify real cost savings before triggering payment. But Qwen's explanation is the only human-readable part of the entire flow, which is crucial for users or judges who want to understand why the Agent acted as it did.
Built-in honesty checks are the second. Each run also independently computes the deterministic cost-optimal window and compares it against Qwen's choice. If Qwen's answer isn't actually the cheapest option, the Agent loudly logs the discrepancy instead of quietly trusting the model. In all real runs to date, Qwen's choices have matched the true optimum.
This design means: a large model's mistake won't cause financial loss—it will only reduce the savings.
Architectural Safety Isolation
From an architectural standpoint, Qwen never touches the numbers that determine payment—it only chooses which window to act in. The oracle independently re-derives baseline and actual costs from REGLO's real data and signs them; the smart contract checks the savings amount itself before paying out.
Qwen's errors or hallucinations at worst mean smaller savings—never incorrect or fraudulent payments. This separation mechanism is precisely the key to involving LLMs in real money decisions while remaining safe.
In the project author's words: "The contract and oracle never read the LLM's wording." Verification authority rests entirely with deterministic code.
Oracle in the blockchain context refers to an intermediary service that securely and trustworthily writes off-chain real-world data (such as the solar curtailment data and electricity prices here) on-chain. Smart contracts themselves cannot directly access the internet, so oracles are needed to act as "data couriers." In this project, the oracle independently re-derives baseline and actual costs from REGLO's real data and signs them; only data it signs is accepted by the contract. This layer of design completely separates "which window the LLM chooses" from "how much money was actually saved," so even if the LLM judges incorrectly, on-chain settlement still relies on objective data rather than the model's wording.
Real Payment Proof
A run against real REGLO data, using Qwen reasoning, produced a real payment on the Monad testnet: 0x666c6090caba0282d6b96c148c6206cd0778635eb2f2131e0a063ee77c99b09a.
The same code path also supports Kimi and a local Ollama fallback, so the Agent can keep working even if a provider is unreachable. But in this run, every decision genuinely came from Qwen.
Full project address: github.com/edmundjeevan/reglo-agent-pipeline
One-line Summary
REGLO Agent lets Qwen choose the optimal scheduling window while cryptography handles verification—LLM errors cost efficiency, not money.
Paragraph Summary
REGLO Agent is an AI Agent built for the Monad Metropolis hackathon, whose core task is to use UK solar curtailment and electricity price data to find the best time slots for deferring compute tasks. Decisions are made by Qwen through DashScope's OpenAI-compatible interface, selecting the optimal schedule from candidate windows and providing a verifiable natural language explanation. The architecture's key is separating the LLM's choice authority from fund verification authority: the contract and oracle never read the model's wording, but independently re-derive costs from real data and verify savings before triggering payment. The Agent also has built-in honesty checks, independently computing the deterministic optimum each run and comparing it against Qwen. One real run has completed an on-chain payment on the Monad testnet, and the code supports Kimi and local Ollama fallbacks.
Related articles

Amphibious Transforming Drone: Beyond 100x Power Savings, What Are the Real Needs?
Is the amphibious transforming drone just a gimmick? Starting from the 100x power difference of the M4 Morphobot, explore real application scenarios and thesis topic ideas, analyzing boundary conditions where pure drones and pure ground robots both fail.

Warhound Raises $200 Million: Genetically Engineered "War Dogs" Paired with Anduril Gear
Warhound raises $200M, backed by Ben Lamm and Palmer Luckey, to genetically engineer dogs for military and law enforcement use and equip them with Anduril gear. This article analyzes its technology direction, funding logic, and ethical controversy.

Claude API Comes to Google Cloud: IAM Integration and SDK Access Guide
Anthropic hosts the full Claude API on Google Cloud with IAM-controlled permissions and unified billing. This guide covers the Vertex AI and Anthropic-hosted entry points, IAM role configuration, and SDK access.