Skip to content

Set the node's own prices against its cost on the Energy page - #6

Merged
Virgile-pct merged 1 commit into
mainfrom
feat/price-vs-cost
Oct 30, 2026
Merged

Virgile-pct merged 1 commit into
mainfrom
feat/price-vs-cost

Conversation

@Virgile-pct

Copy link
Copy Markdown
Collaborator

The Energy page now sets the node's own price against what serving costs it, which is the part of mesh-llm#2320 step 2 that wallet pricing doesn't show today. No host change: sellers price in msat per million tokens, and the node's own offers are already in /v1/models.

  • --btc-price gives the price of one bitcoin in the tariff's currency. With it, the snapshot also carries btc_price, cost_msat_per_1m_output_tokens and cost_msat_per_1m_output_tokens_total. The rate is set by hand: the plugin asks no outside service for it. It needs --electricity-price-per-kwh, and a repeated or non-positive value stops the plugin at startup, like the other flags.
  • bundle/energy.js reads the payment block of /v1/models every 30 s (the console's chat reads the same block). For each model the node serves (an offer with local: true), it shows the node's own output price, the cheapest other seller of that model, and a verdict: above cost (above the idle-included cost), pays only if the machine runs anyway (between the two costs), or below cost. Without --btc-price the prices show in msat with a hint to set it. A failed listing leaves the energy figures and the last prices in place.
  • The cost is measured across every model the node serves, not per model, and the page says so.
  • README: the flag, the new fields and the verdicts.

Checked locally: fmt, clippy -D warnings, 32 Rust tests (new: flag parsing and refusals, the msat conversion, the snapshot fields appearing only with --btc-price), and the page in a harness with a fake /api/status and /v1/models: four served models hit each verdict, a model served only elsewhere is left out, and without --btc-price the hint shows. No console errors.

The live run on the RTX 4070 Ti is waiting for the GPU to be free; I'll add it here.

With --btc-price, the price of one bitcoin in the tariff's currency, the
plugin also reports both costs in msat per million output tokens, the unit
sellers price in. The Energy page reads the node's own output price for each
model it serves from the payment block of /v1/models, every 30 s, and marks it
above cost, paying only if the machine runs anyway, or below cost, next to the
cheapest other seller of the same model.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26029e65-b6da-4ec9-b48d-aa0872458460
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Virgile-pct

Copy link
Copy Markdown
Collaborator Author

Live run on Windows 11, RTX 4070 Ti: the official v0.78.0-preview.40959817943.1 binary, this branch's packaged zip installed with plugins install --archive, Qwen3-8B Q4_K_M, --electricity-price-per-kwh 0.2016 --currency EUR --btc-price 69700 (this morning's rate), and the model priced at mesh-llm's default seller rate with wallet pricing <model> --input-msat-per-million 500 --output-msat-per-million 1500.

/v1/models carried the node's own offer (local: true, 1,500 msat output), and the Energy page showed it against the measured cost: 0.104 EUR per million output tokens on top of a 19 W idle draw, 0.122 EUR idle included, so 149k and 175k msat. The row reads "Below cost" in red: the default rate (about 0.001 EUR) is roughly 99 times under what the electricity costs on this card.

@Virgile-pct
Virgile-pct merged commit 844951c into main Oct 30, 2026
9 checks passed
@Virgile-pct
Virgile-pct deleted the feat/price-vs-cost branch October 30, 2026 14:34
Virgile-pct added a commit that referenced this pull request Oct 30, 2026
The Energy page sets the node's own prices against its cost (#6).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant