<!-- https://zerolog.ch/docs/attach · Docs / Chat -->
# Files and images in chat

Attach with the clip, or paste an image straight into the box. Up to 8 files go with one message.

Files uploaded to a chat may be checked for known malware. This check looks at the file, not your chat messages. A clean result cannot guarantee that a file is safe.

- **Text files**: are read into the message
- **Images**: go to vision-capable models
- **Other files**: go to the container

## It stays with the chat

Attachments are stored with the chat, so the model can refer back to them later.

## Large files stay in the container

A text file over about 100,000 characters is not put into the message. It is kept [in the container](https://zerolog.ch/docs/containers), and the model gets its path, line count and an outline, then reads the parts it needs. That is cheaper, because it does not read the whole file every turn. Files that are not text, such as PDFs or Office documents, go to the container too, and the model gets only their path. You can also put any file there yourself.

*What the model reads each turn*

### Attached to the chat

Turn 1

Turn 2

Turn 3

The whole file, every turn.

### Read from the container

Turn 1

Turn 2

Turn 3

Only the part it needs.

The bars sketch the idea. They are not measured sizes.

## Where an attachment goes

Mermaid source of the diagram on this page:

```mermaid
%% Files and images in chat: where an attachment goes. Facts from web/apps/web/components/chat/attachments.ts, server/attachments.js (INLINE_MAX, MAX_ATTACH_COUNT, grossdateiBlock).
flowchart TB
  file["You attach a file<br/>or paste an image"]
  img2["Scaled to 1536 px,<br/>sent with the<br/>message"]
  small["Text goes in<br/>the message"]
  big["Kept in the<br/>container"]:::hot
  path["Stored in the<br/>container, only the<br/>path is sent"]
  parts["Model gets path,<br/>lines and outline,<br/>reads parts"]:::hot

  file -->|Image| img2
  file -->|Text, up to<br/>100,000 chars| small
  file -->|Text, over<br/>100,000 chars| big
  file -->|Other file| path
  big --> parts

  linkStyle 2 stroke:#8f7ac9
  linkStyle 4 stroke:#8f7ac9
```
