> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/models/muse-glimmer/train.md).

# Muse Glimmer Fine-tuning Guide

You can now fine-tune Meta’s Muse Glimmer-30B with [Unsloth](https://github.com/unslothai/unsloth). Muse Glimmer is a 30B parameter multimodal agentic model optimized for local deployment.

Muse Glimmer is a dense causal Transformer with a dedicated perception encoder, designed for autonomous agents requiring planning, tool execution, multimodal understanding, and long-context reasoning.

* If you want to preserve reasoning ability, mix reasoning-style examples with direct answers. Avoid training only short answers, as this may reduce multi-step reasoning performance.
* LoRA / QLoRA is recommended for most users. Full fine-tuning requires substantially more VRAM.
* Muse Glimmer supports long contexts up to 131K+ tokens, but start fine-tuning with shorter contexts first.
* After fine-tuning, you can export your model for local inference formats.

## Quick Start

### 🦥 Unsloth Guide

{% columns %}
{% column %}
Gemma 4 can be run and fine-tuned in [Unsloth](/docs/new/studio.md) Desktop, our new open-source web UI for local AI.

With Unsloth Studio, you can run models locally on **MacOS, Windows**, Linux and train NVIDIA GPUs. Intel, MLX and AMD training support coming this month.
{% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="/files/Ke7ekUSd9lgl6WQU7hMC" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

{% stepper %}
{% step %}

#### Install Unsloth

Run in your terminal:

**MacOS, Linux, WSL:**

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

**Windows PowerShell:**

```bash
irm https://unsloth.ai/install.ps1 | iex
```

{% hint style="success" %}
**Installation will be quick and take approx 1-2 mins.**
{% endhint %}
{% endstep %}

{% step %}

#### Launch Unsloth

**MacOS, Linux, WSL and Windows:**

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

**Then open `http://localhost:8888` in your browser.**
{% endstep %}

{% step %}

#### Train Gemma 4

On first launch you will need to create a password to secure your account and sign in again later. You’ll then see a brief onboarding wizard to choose a model, dataset, and basic settings. You can skip it at any time.

Search for Gemma 4 in the search bar and select your desired model and dataset. Next, adjust your hyperparameters, context length as desired.

<div data-with-frame="true"><figure><img src="/files/Ke7ekUSd9lgl6WQU7hMC" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Monitor training progress

After you click start training, you will be able to monitor and observe the training progress of the model. The training loss should be steadily decreasing.\
Once done, the model will be automatically saved.

<div data-with-frame="true"><figure><img src="/files/ubTuron1yXPBa3XZI3Br" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Export your fine-tuned model

Once done, Unsloth Studio allows you to export the model to GGUF, safetensor etc formats.

<div data-with-frame="true"><figure><img src="/files/ln7pSeyju0ZaUmaGRkg9" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Compare fine-tuned model vs original model

Click on `Compare Mode` to compare the LoRA adapter and the original model.

<div data-with-frame="true"><figure><img src="/files/J6JfXL3HnsXoxrYEtTnx" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

## Muse Glimmer-30B Overview

| Model Architecture | Dense Causal Transformer with Perception Encoder |
| ------------------ | ------------------------------------------------ |
| Parameters         | \~29.6B                                          |
| Layers             | 52                                               |
| Hidden Dimension   | 6656                                             |
| Attention          | Local, Local, Local, Global repeating            |
| Sliding Window     | 2048                                             |
| Attention Heads    | 32 Query / 2 KV                                  |
| FFN                | SwiGLU                                           |
| Context Length     | 131,072+                                         |
| Vision Encoder     | ViT-G/14 (\~1.8B parameters)                     |
| Modalities         | Text + Image input, Text output                  |
| Vocabulary         | 202,048 tokens                                   |

Muse Glimmer uses:

* Long-context reasoning
* Tool-use planning
* Failure recovery
* Multimodal understanding
* Agent scaffold compatibility
* Controllable reasoning effort

## Recommended Fine-tuning Method

### LoRA Fine-tuning

For most users, LoRA is the recommended approach.

Advantages:

* Much lower VRAM usage
* Faster training
* Smaller adapter files
* Easy model sharing
* Preserves base model capabilities

Recommended starting configuration:

```python
r = 16
lora_alpha = 16
lora_dropout = 0
```

For more difficult agentic tasks:

```python
r = 32
lora_alpha = 32
```

Start smaller and increase only if required.

## QLoRA Fine-tuning

QLoRA is recommended when GPU memory is limited.

Muse Glimmer was designed for efficient local deployment, including quantized inference. The same principles make QLoRA a practical fine-tuning approach.

Use QLoRA when:

* Training on consumer GPUs
* Fine-tuning larger datasets
* Keeping memory usage low
* Training multiple adapters

Example:

```python
load_in_4bit = True
```

***

## Multimodal Fine-tuning

Muse Glimmer includes a dedicated perception encoder for image understanding.

For vision tasks:

* Keep the perception encoder frozen initially.
* Fine-tune language layers first.
* Only train vision components if your dataset requires visual adaptation.

Good multimodal datasets include:

* Screenshot understanding
* Document reasoning
* Chart interpretation
* GUI interaction
* Image-grounded agent workflows

Example format:

```json
{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "image",
          "image": "example.png"
        },
        {
          "type": "text",
          "text": "Explain this screenshot."
        }
      ]
    },
    {
      "role": "assistant",
      "content": "The screenshot shows..."
    }
  ]
}
```

## Agentic Fine-tuning

Muse Glimmer is optimized for autonomous agent workflows.

For agent datasets, include:

* Tool descriptions
* Correct function calls
* Tool outputs
* Recovery from failures
* Multi-step planning examples
* Permission handling
* Final user-facing responses

Example:

```json
{
  "messages": [
    {
      "role": "user",
      "content": "Find my latest report and summarize it."
    },
    {
      "role": "assistant",
      "content": "I will search your files.",
      "tool_calls": [
        {
          "name": "file_search",
          "arguments": {
            "query": "latest report"
          }
        }
      ]
    }
  ]
}
```

## Dataset Preparation

Muse Glimmer works best with high-quality instruction datasets.

Recommended datasets:

* Multi-turn conversations
* Tool-use traces
* Coding tasks
* Agent trajectories
* Vision-language examples
* Reasoning examples

Avoid:

* Duplicate examples
* Low-quality generated answers
* Incorrect tool calls
* Inconsistent formatting

For reasoning preservation:

* Keep reasoning examples diverse.
* Include final answers.
* Avoid training exclusively on chain-of-thought outputs.

## Training Settings

A good starting configuration:

```python
trainer = SFTTrainer(
    max_seq_length = 4096,
    packing = True,
)
```

Recommended:

| Setting               | Value     |
| --------------------- | --------- |
| Batch size            | 1-8       |
| Gradient accumulation | 4-16      |
| Learning rate         | 2e-4 LoRA |
| Epochs                | 1-3       |
| Optimizer             | AdamW     |
| Precision             | BF16      |

For long-context training:

* Increase sequence length gradually.
* Monitor VRAM usage.
* Use gradient checkpointing.

## Reasoning Fine-tuning

Muse Glimmer supports controllable reasoning strength:

```
Reasoning strength: low
Reasoning strength: medium
Reasoning strength: high
Reasoning strength: xhigh
```

For complex tasks:

* Coding → high/xhigh
* Agent workflows → high/xhigh
* Simple assistants → medium
* Fast responses → low

When fine-tuning reasoning models:

* Include difficult examples.
* Include failures and corrections.
* Include multi-step tasks.
* Preserve general capabilities.

## Exporting Your Fine-tuned Model

After training, export your adapter:

```python
model.save_pretrained("muse-glimmer-lora")
tokenizer.save_pretrained("muse-glimmer-lora")
```

You can merge LoRA adapters:

```python
model.merge_and_unload()
```

Export formats can include:

* Hugging Face format
* Safetensors
* GGUF-compatible formats

## Inference Settings

Recommended generation settings:

```python
temperature = 1.0
top_p = 0.95
top_k = 64
```

For difficult reasoning tasks:

```
Reasoning strength: high
```

For fast conversations:

```
Reasoning strength: low
```

## Hardware Requirements

Muse Glimmer is optimized for local deployment.

Approximate requirements:

| Training Method  | Hardware                                            |
| ---------------- | --------------------------------------------------- |
| LoRA             | High-memory GPU recommended                         |
| QLoRA            | Consumer GPUs possible depending on sequence length |
| Full Fine-tuning | Multi-GPU systems                                   |

The model itself can run efficiently using quantized weights, with released 4-bit variants targeting 24GB and 32GB consumer hardware.

## Safety Fine-tuning

When deploying Muse Glimmer in agentic systems:

* Add tool permission checks.
* Validate external actions.
* Require confirmation for irreversible operations.
* Test prompt injection resistance.
* Evaluate privacy risks.

Recommended safety datasets:

* Tool misuse examples
* Permission boundaries
* Unsafe instruction handling
* Data minimization examples

## Troubleshooting

### Out of Memory

Try:

* Reduce sequence length
* Lower LoRA rank
* Enable 4-bit loading
* Reduce batch size
* Enable gradient checkpointing

### Model Quality Decreases

Try:

* Reduce learning rate
* Train fewer epochs
* Increase dataset quality
* Mix original instruction examples

### Tool Calls Become Incorrect

Add:

* More tool-call examples
* Correct schemas
* Failure recovery examples
* Multi-turn workflows

## Summary

Muse Glimmer-30B is a powerful local agentic model designed for:

* Autonomous workflows
* Coding agents
* Tool use
* Multimodal reasoning
* Long-context tasks

For most users:

1. Start with LoRA or QLoRA.
2. Use high-quality instruction datasets.
3. Preserve reasoning examples.
4. Keep vision layers frozen initially.
5. Export adapters for deployment.

With the right dataset and training setup, Muse Glimmer can be adapted into specialized local agents while retaining its reasoning, multimodal, and tool-use capabilities.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://unsloth.ai/docs/models/muse-glimmer/train.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
