How to Reduce GPU Power Consumption and Fan Noise Using the --power Flag in ds4

Use the --power flag (accepting values 1‑100) when launching ds4 components or the /power slash command in the interactive CLI to cap the GPU duty cycle, which directly lowers power draw and acoustic fan noise at the cost of reduced inference throughput.

The ds4 project by antirez is a local large language model inference engine that exposes fine‑grained control over hardware utilization. The --power flag allows you to throttle the GPU’s power limit, making it possible to run demanding models on workstations where thermal management and noise levels are critical constraints. By adjusting the power percentage, you configure the engine to request a specific duty cycle from the GPU driver, balancing performance against hardware stress.

How the --power Flag Works Under the Hood

When any ds4 component (server, agent, or benchmark tool) initializes, it parses command‑line arguments to configure the inference engine. In ds4_server.c, the argument parser specifically handles --power by converting the next token to an integer and validating that it falls within the allowed hardware range:

} else if (!strcmp(arg, "--power")) {
    c.engine.power_percent = parse_int_arg(need_arg(&i, argc, argv, arg), arg);
    if (c.engine.power_percent < 1 || c.engine.power_percent > 100) {
        server_log(DS4_LOG_DEFAULT, "ds4-server: --power must be between 1 and 100");
    }
}

Source: ds4_server.c#L12946-L12949

This validated value is stored in the engine configuration structure. At runtime, the system applies the limit by calling ds4_session_set_power(), defined in ds4.c. This function forwards the percentage to the GPU driver’s power‑limiting API, which adjusts the maximum power envelope (TDP) for the device:

int ds4_session_set_power(ds4_session *s, int power_percent);

Source: ds4.c#L57804

Command-Line Usage Examples

You can append --power <N> to the startup command of any ds4 binary. The built‑in help text, located in ds4_help.c, documents this flag for each component.

Starting the Server with Reduced Power

To launch the inference server at 60 % of the GPU’s maximum power capacity:

ds4-server --power 60 --host 127.0.0.1 --port 8000

Source: ds4_help.c#L471

Running the Agent Quietly

For background agent processes where silence is prioritized over speed, set a lower percentage:

ds4-agent --power 50

Source: ds4_help.c#L474

Benchmarking with a Power Cap

When profiling model performance under thermal constraints, explicitly define the power budget:

ds4-bench --prompt-file long.txt --power 70

Source: ds4_help.c#L477

Adjusting Power Dynamically via the CLI

If you are already inside the interactive ds4 CLI, you do not need to restart the process to change the power limit. The /power slash command allows runtime adjustment. The handler in ds4_cli.c parses your input, validates the range, and invokes the session’s power update routine:

/* Inside the CLI command handler */
int new_power = parse_power_percent(arg);
if (new_power >= 1 && new_power <= 100) {
    ds4_session_set_power(chat.session, new_power);
    printf("Power set to %d%%.\n", new_power);
}

Source: ds4_cli.c#L1643-L1651

Example usage within the prompt:

/power 80

Understanding the Performance Trade‑Off

Reducing the GPU duty cycle via the --power flag forces the graphics driver to throttle clock speeds to maintain the lower TDP. This has two immediate effects:

  1. Acoustic Reduction: Lower power consumption generates less heat, causing the cooling system to reduce fan RPM, which significantly decreases noise.
  2. Throughput Impact: The GPU executes fewer operations per second, resulting in lower token‑generation rates (tokens per second) during inference.

According to the source documentation in ds4_help.c, the valid range is strictly 1 to 100, where 100 represents the default, unconstrained power state.

Summary

  • The --power flag accepts an integer between 1 and 100 to set the GPU power limit.
  • It is implemented in ds4_server.c and applied via ds4_session_set_power() in ds4.c.
  • Use it at startup (ds4-server --power 60) or dynamically via the /power command in the CLI.
  • Lower values reduce fan noise and power draw but decrease inference speed.

Frequently Asked Questions

What is the valid range for the --power flag?

The flag accepts any integer from 1 to 100, inclusive. Values outside this range trigger a validation error logged by the server at startup, as enforced by the argument parser in ds4_server.c.

Does lowering the power limit affect inference speed?

Yes. Constraining the GPU’s power envelope causes the driver to lower clock speeds, which reduces the number of tokens generated per second. This is the direct trade‑off for achieving quieter operation and lower energy consumption.

Can I change the power limit without restarting the server?

Yes. The interactive CLI supports the /power <N> command, which calls ds4_session_set_power() to update the limit at runtime without interrupting the session or reloading the model.

Is the --power flag available for all ds4 components?

Yes. The flag is uniformly supported across the server, agent, bench, and CLI components, with usage documentation present in ds4_help.c for each tool.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →