Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(clippy): die Kontextrundung nutzt div_ceil aus der Standardbibliothek

David6ff8ab5bf2fc
diff --git a/src-tauri/src/commands/engine.rs b/src-tauri/src/commands/engine.rs
index 9d3d925d..37c3c8a1 100644
--- a/src-tauri/src/commands/engine.rs
+++ b/src-tauri/src/commands/engine.rs
@@ -306,7 +306,7 @@ pub(crate) fn plan_offload(input: &OffloadInputs) -> OffloadPlan {
let blocks = read_from_header.unwrap_or(ASSUMED_BLOCK_COUNT);
// Round the context UP to whole thousands: a 6000 token context pays for
// six, because the error has to point at reserving too much.
- let ctx_k = ((input.ctx.max(1) as u64) + 1023) / 1024;
+ let ctx_k = (input.ctx.max(1) as u64).div_ceil(1024);
let kv_per_layer = KV_BYTES_PER_LAYER_PER_1K_CTX * ctx_k;
let whole = input.model_bytes + kv_per_layer * blocks as u64 + VRAM_OVERHEAD_BYTES;
if whole <= vram {