Skip to content

deepseek-v4.1-flash: 10–60 s to first token once images are in context; deepseek-v4.1-flash-fast is unaffected (3–4 s) #1009

Open

Description

@slovx2

Summary

With deepseek/deepseek-v4.1-flash, once the agent has read an image, every later model request in the session waits 10–60 s before the first token. Text-only requests in the same session take 2–4 s. The wait gets worse as more images accumulate in context.

deepseek/deepseek-v4.1-flash-fast does not have the problem: the same sessions, with the same images, get their first token in 3–4 s.

In day-to-day use this makes the regular V4.1 Flash feel hung after the agent reads one or two screenshots, because images stay in context and are re-sent on every turn.

Measured with the CLI in headless mode (cmd -p --output-format json), timing each model request from its model_request_start event to the first thinking_* / text_delta event.

Time to first token, by number of images already in context

Images in context deepseek-v4.1-flash deepseek-v4.1-flash-fast
0 (text-only, or before the first read) 2.0 – 4.4 s 1.5 – 1.9 s
1 9.6 / 12.5 / 14.4 / 14.6 / 22.4 s 2.7 / 2.9 / 3.0 / 3.0 s
2 35.1 / 12.5 s 3.2 / 3.3 s
3 11.1 / 18.6 s 3.9 / 3.8 s
4 23.1 / 43.1 s 4.0 / 4.2 s
5 60.0 / 20.4 s 4.2 / 4.4 s

Wall-clock time for the same "read six images one by one" task: 118 s and 149 s on V4.1 Flash, 26 s and 27 s on V4.1 Flash Fast.

In the single-image runs both models read the text in the image correctly, and both count about 1,020 input tokens per image, so this does not look like a difference in what the model receives.

Cache reads do not grow past the images on V4.1 Flash

Usage reported by model_request_end in one six-image run of each model:

Images in context V4.1 Flash: input / cache read V4.1 Flash Fast: input / cache read
1 17,547 / 16,384 17,555 / 16,640
2 18,563 / 16,384 18,587 / 17,664
3 19,588 / 16,384 19,612 / 18,688
4 20,612 / 16,640 20,636 / 19,712
5 21,637 / 16,640 21,661 / 20,736

On V4.1 Flash Fast, cache reads grow by 1,024 tokens with each image. On V4.1 Flash they stay at about 16.4K no matter how many images are in context. My guess is that V4.1 Flash reprocesses every image on every turn, which would explain why the delay grows as images accumulate. That part is an inference, not something I measured.

Expected Behavior

  • Time to first token on deepseek/deepseek-v4.1-flash with images in context should be in the same range as deepseek/deepseek-v4.1-flash-fast (3–4 s here), not 10–60 s.
  • Cache reads should extend past image content on V4.1 Flash the way they do on V4.1 Flash Fast.
  • During a long wait, some heartbeat or progress signal would help the client tell "still working" from "connection dead".

Actual Behavior

  • Before any image is read: 2.0–4.4 s to first token.
  • With one image in context: 9.6–22.4 s.
  • With four or five images: 20–60 s.
  • Nothing is streamed during the wait.
  • Cache reads stay flat at about 16.4K tokens while input grows from 17.5K to 21.6K.
  • The same runs on deepseek/deepseek-v4.1-flash-fast stay at 2.7–4.4 s.

Steps to reproduce the issue

  1. Create an empty directory and put six PNG files in it, 1.png to 6.png. Mine are 1223×1286 infographics of about 2.3 MB each (one image plus flipped and rotated copies). The CLI's read_file converts them to JPEG before sending; it reported the first one as 507.8 KB at 1141×1200.

  2. Run in that directory:

    cmd -p "Read 1.png, 2.png, 3.png, 4.png, 5.png and 6.png in the current directory, one at a time, finishing each read before starting the next. When all are read, answer with one sentence: how many images did you read. Do nothing else." -m deepseek/deepseek-v4.1-flash --output-format json --no-session --skip-onboarding --no-auto-update -t --max-turns 6

    (I used the equivalent prompt in Chinese.)

  3. Timestamp the NDJSON events as they arrive. For each model_request_start, record the time until the first thinking_start, thinking_delta or text_delta, and the usage in model_request_end.

  4. Repeat with -m deepseek/deepseek-v4.1-flash-fast and compare.

  5. For a baseline, run a text-only prompt on both models with the same flags.

With --max-turns 6 the run stops after five images are in context, which is enough to see the trend.

Command Code Version

1.79.2

Operating System

macOS (Tahoe 26.5.1, arm64)

Terminal/IDE

Headless (cmd -p)

Shell

zsh

Session file (optional)

None. The runs used --no-session.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions