Skip to content

[Bug] Changing context length and clicking Apply reloads with a missing config error, but the selected context length is applied after manually reloading the model #5238

@okaybeydanol

Description

@okaybeydanol

Bug Description

When using Unsloth Studio with GGUF models, changing the context length and clicking Apply triggers a model reload. After waiting for some time, the reload fails with a “No config file found” error.

However, if I manually select/load the model again afterward, the last context length I selected is actually applied correctly.

So the setting appears to be saved, but the automatic reload path after changing context length fails incorrectly.

This is a small but confusing workflow bug. It does not completely block usage, because I can manually reload the model afterward and get the desired context length, but the error message makes it look like the model path/config is broken when it is not.


Error / Log Output

After changing context length and clicking Apply, Unsloth Studio shows:

Switching models. Reloading with updated chat template. Loading cached model into memory.
Failed to load model: This model is not supported yet. Try a different model. (Original error: Unsloth: No config file found - are you sure the `model_name` is correct? If you're using a model on your local device, confirm if the folder location exists. If you're using a HuggingFace online model, check if it exists.)

Environment

OS:

Lubuntu 24.04

Kernel:

6.17.0-22-generic

GPU:

NVIDIA RTX 5090 Laptop GPU

NVIDIA Driver:

595.58.03

CUDA:

CUDA Toolkit / CUDA Version: 13.1

Unsloth Studio environment:

Python: /home/theswalk/.unsloth/studio/unsloth_studio/bin/python
transformers: 4.57.6
torch: 2.10.0+cu130
unsloth: 2026.4.8
accelerate: 1.13.0
safetensors: 0.7.0

Model Type

This happens while working with GGUF models.

GGUF models otherwise load and run correctly on the same system. The issue appears only when changing the context length and using the automatic Apply / reload flow.


Steps to Reproduce

  1. Open Unsloth Studio.
  2. Load a local GGUF model.
  3. Confirm that the model loads and works normally.
  4. Change the context length setting.
  5. Click Apply.
  6. Wait while Studio attempts to reload the model.
  7. After some time, the reload fails with:
    No config file found - are you sure the `model_name` is correct?
    
  8. Manually select/load the same model again.
  9. The model loads successfully.
  10. The context length selected earlier is now applied correctly.

Expected Behavior

When changing context length and clicking Apply, Unsloth Studio should reload the same model cleanly with the updated context length.

Expected flow:

Change context length
Click Apply
Studio reloads the same model
Model loads successfully
New context length is active

No missing config error should appear if the model path is valid and the model can be loaded manually.


Actual Behavior

Unsloth Studio attempts to reload the model but fails with:

No config file found - are you sure the `model_name` is correct?

The confusing part is that the model itself is not actually missing or invalid.

After manually selecting/loading the same model again, it works, and the context length I selected before is applied.


Why This Seems Like a Bug

The error message suggests the local model folder or config is missing:

No config file found

But that does not match the actual situation because:

  1. The same GGUF model loads successfully before changing context length.
  2. The same GGUF model loads successfully again after the failed automatic reload.
  3. The selected context length is preserved and applied after manual reload.
  4. GGUF models may not have the same config file structure as safetensors/Hugging Face models, so the reload path may be using the wrong loader or wrong model reference during the automatic apply/reload step.

This suggests that the context-length Apply flow may be losing the correct local GGUF model path, using the wrong model identifier, or incorrectly switching to a Hugging Face / config-based loading path during reload.


Impact

This is not a complete blocker, but it is confusing and interrupts the workflow.

The workaround is:

1. Change context length.
2. Click Apply.
3. Wait for the reload to fail.
4. Manually select/load the same model again.
5. The selected context length is then active.

This works, but it should not be necessary.


Requested Fix

Please check the model reload logic after changing context length in Unsloth Studio, especially for local GGUF models.

Possible areas to inspect:

  1. Whether the automatic reload path preserves the correct local GGUF model path.
  2. Whether the reload path accidentally treats the GGUF model as a Hugging Face safetensors model.
  3. Whether the cached model reference loses the original file path.
  4. Whether the context-length apply flow updates settings but then calls the wrong loader.
  5. Whether the error message should be different for GGUF models.

Ideally, changing context length and clicking Apply should reload the same GGUF model directly without requiring the user to manually reselect the model.


Workaround

Manually reload the model after the failed automatic reload.

The selected context length is preserved, so after manually loading the same model again, the desired context length is applied.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions