Commit 762d326
Changed files (1)
lib
elelem
llama
lib/elelem/llama/plugin.rb
@@ -5,14 +5,16 @@ Elelem::Providers.register(:gguf) do
Elelem::Net::GGUF.new(
model: ENV.fetch("GGUF_MODEL", File.expand_path("~/.elelem/models/Qwen3.8-27B-UD-Q4_K_XL.gguf")),
- # 0 = auto: the native shim asks llama.cpp for the model's trained max
- # context (falling back to smaller sizes if it doesn't fit), and picks
- # thread count from the host's physical cores. Set GGUF_N_CTX/GGUF_THREADS
- # to override.
- n_ctx: Integer(ENV.fetch("GGUF_N_CTX", "0")),
- n_threads: Integer(ENV.fetch("GGUF_THREADS", "0")),
+ # n_ctx/n_threads/n_gpu_layers are calculated, not configured: the native
+ # shim asks llama.cpp for the model's trained max context (falling back to
+ # smaller sizes if it doesn't fit) and picks thread count from the host's
+ # physical cores; every layer is offloaded whenever a GPU backend is
+ # present. Convention over configuration -- there's no better answer a
+ # user could supply than what the hardware and model already determine.
+ n_ctx: 0,
+ n_threads: 0,
+ n_gpu_layers: gpu ? 999 : 0,
max_tokens: Integer(ENV.fetch("GGUF_MAX_TOKENS", "4096")),
- n_gpu_layers: Integer(ENV.fetch("GGUF_N_GPU_LAYERS", gpu ? "999" : "0")),
temp: Float(ENV.fetch("GGUF_TEMP", "0.7")),
seed: Integer(ENV.fetch("GGUF_SEED", "-1"))
)