Vessim is a Python library for simulating datacenter energy systems.
Vessim models the interaction between datacenter demand and energy infrastructure, helping you understand how design and control decisions affect cost, carbon emissions, and resilience.
Documentation · Getting started · Explore example results
- Simulation studies: Compare infrastructure and control strategies across demand, weather, and operating scenarios.
Explore design choices through parameter sweeps, optimization, or probabilistic simulations.
- Live modeling: Connect real applications to a simulated energy system through REST APIs.
Test how a scheduler or controller responds to changing power availability.
- Digital twins: Model an energy system alongside the real installation using live measurements.
Explore possible futures, such as prolonged low renewable generation or a grid outage.
Getting started
Install Vessim with Python 3.9 to 3.15:
python -m pip install vessim
This example models three days of datacenter demand, solar generation, and battery operation.
Surplus solar power charges the battery, which supplies demand when solar generation falls.
The grid supplies any remaining deficit and receives surplus power once the battery is full.
Download solar_example.csv into your working directory, then run:
import vessim as vs
# Scale the solar profile to a 2.4 kW installation.
solar = vs.Trace.from_csv("solar_example.csv", column="Berlin", scale=2400)
env = vs.Environment(sim_start="2026-01-01", step_size=5 * 60)
env.add_microgrid(
name="site",
actors=[
vs.Consumer("load", signal=700),
vs.Producer("solar", signal=solar),
],
dispatchables=[vs.SimpleBattery("battery", capacity=1000), vs.GridConnection()],
)
recorder = env.add_controller(vs.Recorder("results/basic_example"))
env.run(until=3 * 24 * 3600)
metrics = recorder.metrics["microgrids"]["site"]
print(f"Grid import: {metrics['grid_import'] / 1000:.2f} kWh")
print(f"Grid export: {metrics['grid_export'] / 1000:.2f} kWh")
Grid import: 26.71 kWh
Grid export: 11.08 kWh
Explore this example in your browser, or open your saved results locally:
python -m vessim view results/basic_example
The Getting Started walkthrough explains how the components work together.
To use your own data, see Actors and Signals.
Explore further
Run the examples locally with a shared setup and reproducible commands.
For live measurements and REST control, install pip install 'vessim[live]' and use vs.Environment.live().
To connect external simulators through Mosaik, install pip install 'vessim[mosaik]'.
Publications
If you use Vessim in your research, please cite:
Philipp Wiesner, Ilja Behnke, Paul Kilian, Marvin Steinke, and Odej Kao.
Vessim: A Testbed for Carbon-Aware Applications and Systems.
ACM SIGENERGY Energy Informatics Review 4 (5), 2024.
More papers are listed in the documentation!
About
Vessim was originally developed at the research group for Distributed and Operating Systems at TU Berlin. It is now maintained at the Machine Learning Systems Lab at the University of Cambridge.
评论