> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Model scheduling

> Understand how agents, approvals, and background work share one local model.

Linger's **local model scheduler** is a per-computer admission queue that coordinates how foreground chats, tool approvals, and background maintenance jobs share one local model. Foreground work that you wait for starts immediately. Background jobs, including memory updates, profile refreshes, and context compaction, wait their turn and run one at a time after two quiet minutes.

A local model can serve one more request only by slowing the others. The scheduler keeps your interactive chats responsive by deferring background work until the model is quiet.

This page explains the three kinds of work, when each one starts, how chats preempt waiting background jobs, and how scheduling behaves after a restart. To learn which model runs on your machine, read [Local models](/docs/models/local-inference.md).

![Chats on one computer start at once, and background jobs run one at a time after two quiet minutes.](https://mintcdn.com/lev9-doc/NvxBLBs21OWZesZz/images/feature-model-scheduling.jpg?fit=max\&auto=format\&n=NvxBLBs21OWZesZz\&q=85\&s=30f1f010769b1d1d9f60b0a3c6a3539d)

Chats start at once; background work waits for two quiet minutes.

## Which work starts first?

Foreground work always starts first, and the queue never holds it. Background work and compaction wait for a quiet model.

| Work | Examples | When it starts |
| - | - | - |
| Foreground | Every agent run, tool approvals, and questions in a recording's **Ask** tab | At once, never queued |
| Background | Agent memory, your memory, profile, insights, and wiki refresh, in that order | One at a time, after 2 minutes with no foreground work |
| Compaction | Shortening the context of a conversation that is not running | Only if background work could start now; otherwise skipped |

## What happens when a chat starts during background work?

The chat starts at once, and the background job waits. A model call that is already running finishes first. The background job keeps its place in the queue. It then waits two more quiet minutes before its next call.

A shorter gap between chats restarts the two-minute wait. On a busy day, background work can wait a long time.

## Does the queue change the order of a conversation?

No. The queue only admits work, and it never reorders a conversation. Within one chat, a new message joins the reply in progress or waits for the next reply. Turns stay in order.

## What happens after a restart?

A restarted service counts as foreground work that just ended. The agent runs that it resumes start before any background work.

## Keep learning

> [card] [Local models](/docs/models/local-inference.md)
>
> See which model and settings Linger picks for your hardware.

> [card] [Agent memory](/docs/knowledge/memory.md)
>
> Learn what agent memory keeps and when it updates.

> [card] [Personal memory](/docs/knowledge/personal-memory.md)
>
> Learn how the personal memory stays current.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.