> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heylinger.com/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.

Every agent, approval, and background job on a computer shares one local model. Linger keeps one queue per computer to decide what reaches the model. Work that someone waits for starts at once. The rest waits its turn, one job at a time, until the model is quiet.

A local model can serve one more request only by slowing the others. The queue keeps your chats fast. The cost is that background work, such as memory and wiki updates, waits for quiet time.

This page explains the three kinds of work, when each one starts, and what happens when they meet. To learn which model runs on your machine, read [Local models](https://docs.heylinger.com/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](https://docs.heylinger.com/models/local-inference.md)
>
> See which model and settings Linger picks for your hardware.

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

> [card] [Personal memory](https://docs.heylinger.com/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.