편집자 노트

dclichang2022/dsh-green-meter

Energy & carbon metering for DeepSeek Harness: per-turn/per-request energy, cache carbon savings, electricity cost.

이것은 DeepSeek Harness(DSH) 플러그인입니다. 이 사이트는 GitHub README, 설치 정보, 유지보수 상태, 공개 보안 시그널을 모아 보여줍니다.

dsh-green-meter

Energy & carbon metering for DeepSeek Harness — see what your agentic sessions cost.

A dsh-plugin that turns every model call into energy (J/kWh), carbon footprint (g CO2e) and electricity cost (CNY) — estimated from token accounting, so it works with any API-backed provider (DeepSeek API, OpenAI-compatible endpoints, local vLLM) without touching hardware.

Install it, chat as usual, and watch your session's energy bill in real time.


✨ Features

SurfaceWhat you see
Composer dock (always visible under the input box)live 能耗 1.5 kJ · 碳 0.2 g readout + per-turn energy sparkline
Detail panel (click the readout)per-turn energy chart, per-request energy list, session totals (tokens / energy / carbon / electricity cost), carbon saved by caching ≈ N trees per year
/greenone-command session energy report
green_meter toolthe agent can query its own energy, carbon, cost and budget at any time
Energy budgetoptional per-session budget — over-budget steps are rejected with a warning
JSONL ledgerevery model call recorded, ready for your own analysis

🚀 Quick start

# 1. Install into your dsh profile
cd ~/.dsh/profiles/web          # (Windows: %USERPROFILE%\.dsh\profiles\web)
pnpm add dsh-green-meter dsh-client-ui-green-meter

# 2. Mount the plugins in your profile's cordis.patch.yml (see examples/)
- insert:
    - id: green-meter
      name: 'dsh-green-meter'

    - id: ui-green-meter
      name: 'dsh-client-ui-green-meter'
      config:
        panelPlacement: popover   # popover = zero-config; sidebar = optional patch

Restart dsh web, refresh, and the readout appears under the composer. Type /green anytime.

Full experience: sidebar panel (optional)

panelPlacement: sidebar renders the detail panel inside the sidebar's blank space. Apply the provided patch and rebuild one DSH package:

cd /path/to/deepseek-harness
git apply /path/to/dsh-green-meter/patches/ui-sidebar-sidebar-energy.patch
pnpm --filter @deepseek-ai/dsh-client-ui-sidebar bundle

⚙️ Configuration

KeyDefaultMeaning
profileproxycalibration profile (proxy, qwen-h20-*, gemma-h20-*, qwen3-4b-*)
carbonFactorKgPerKwh0.5777grid carbon intensity
electricityPriceCnyPerKwh0.56electricity price (CNY/kWh)
dir<DSH_HOME>/green-meterledger directory
budgetJ0 (off)session energy budget in joules

Environment fallbacks: DSH_GREEN_PROFILE, DSH_GREEN_CARBON_FACTOR, DSH_GREEN_PRICE_CNY, DSH_GREEN_DIR, DSH_GREEN_BUDGET_J.

📌 Method notes

  • Estimate, not measurement — energy is modeled from token accounting with calibrated per-model profiles; carbon and cost are energy × configurable factors.
  • GPU operational energy only — CPU, memory, cooling and embodied carbon are out of scope.
  • Cache savings are counterfactual — cached tokens that would otherwise be recomputed.

💎 thebestai

thebestai is our AI platform. 欢迎大家通过反馈意见可以使用我们的 AI Greentoken 系列服务。

Development

pnpm install
pnpm test

License

MIT

REPOSITORY SIGNALS

보안 및 설치 증거

이 점수는 공개 저장소 메타데이터와 이 사이트에 등록된 설치 증거에만 기반하며, 코드 보안 감사와 다릅니다.

출처 추적 가능

공개 플러그인 카탈로그에서 왔으며, 공개 GitHub 저장소로 연결됩니다.

라이선스

저장소가 MIT 라이선스를 선언했습니다.

유지보수 활동

최근 180일 내 코드 업데이트가 있습니다.

설치 증거

재현 가능한 정확한 설치 메타데이터가 아직 등록되지 않았습니다. 저장소 설명에 따라 직접 확인하세요.

설치 라이프사이클 스크립트

검사한 패키지 메타데이터에 설치 라이프사이클 스크립트가 선언되지 않았습니다.