Skip to content

[Feature] Add Unsloth Studio UI value to tune the llama-server --fit-target flag for squeezed extra performance. #4857

Closed

Description

@xyehya

Current implementation using --fit on uses dynamic approximation to identify how many layers llama-server can fit into GPU while leaving a default buffer of around 1GB unused --> forcing more layers into CPU
In some situations where: 1- VRAM is tight (e.g 16GB VRAM) and 2- the GPU is used purely for compute and not graphics (the nvidia_drm module is not loaded) setting --fit-target to 128/256 will 1.enable all layers on the GPU or in the best case 2. fit all layers + the sane KVCache configured into GPU --> at least 10x performance difference in pp and pg..

Activity

  1. added
    feature request
    on Apr 5, 2026
  2. added
    help wanted
    on Apr 6, 2026
  3. aiSynergy37 commented on Apr 6, 2026

    @aiSynergy37
    Contributor

    Opened PR #4882 implementing this request.

    What it adds:

    • Chat Settings UI control for GGUF fit_target (Auto, 64, 128, 256, 512)
    • API field plumbing (fit_target) across load request/response + status
    • backend command wiring: passes --fit-target when --fit on is active
    • runtime state restore from /api/inference/status
    • regression tests in studio/backend/tests/test_native_context_length.py
  4. xyehya commented on Apr 11, 2026

    @xyehya
    Author

    @aiSynergy37 need help testing on my side? I am still getting an issue with forcing a specific context length behind a certain limit. Even though I get a warning (Exceeds estimated VRAM capacity (8,960 tokens). The model may use system RAM.) applying it still falls back to 8,960 tokens of KV cache. Although at this ctx my vram usage is 14GB/16GB (RTX 5080). The backend doesn't seem to respect the UI values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions