Skip to content

[Feature] Allow context offloading to RAM instead of automatically reducing context length #8497

Closed

Description

@NoMansPC

In Unsloth Studio Desktop, the application currently appears to automatically reduce the context length to 4096 tokens when it determines that the requested context size may exceed the available VRAM.

I would prefer the application to offload part of the context/KV cache to system RAM instead of overriding the context length I selected.

For example, if I select a model and configure it to use a 16K context, I would rather have Studio use some system RAM to accommodate the larger context when the entire context cannot fit in VRAM, rather than silently changing the context length to 4096.

When selecting a model, there could be an option such as:

Prioritize VRAM — Automatically reduce context length if necessary.
Allow RAM offloading — Keep the requested context length and offload context/KV cache to system RAM when VRAM is insufficient.
Ask me — Warn the user when the requested context does not fit and let them choose between reducing the context or using RAM offloading.

Ideally, the user's manually selected context length should not be overridden automatically unless they explicitly choose that behavior.

I understand that RAM offloading can reduce performance compared with keeping everything in VRAM. However, for users with plenty of system RAM, I would prefer slower inference with the requested context length over having the application silently reduce the context to 4096 tokens.

This would also make the behavior more predictable, since the context length selected by the user would remain the actual target rather than being changed based solely on the VRAM estimate.

Activity

  1. added
    feature request
    on Aug 11, 2026
  2. danielhanchen commented on Sep 6, 2026

    @danielhanchen
    Member

    Fixed! A context length you set manually is passed through as is now, no more silent shrink. Two things not done yet: no Prioritize VRAM / Allow RAM offloading chooser, and tensor parallel can still lower a pinned context.

    To update: the desktop app updates itself (Settings > General), otherwise unsloth studio update, or in Docker docker exec <container> unsloth-studio-update.

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 request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions