DevKits

Stop Sequence Tester — Preview Where the LLM Output Gets Cut

Enter model output and your stop sequences to see exactly where generation halts and what text is returned. The stop string itself is excluded, just like the API. 100% local.

Last updated:

Comments

Paste what the model would generate plus your stop sequences, and this tester shows exactly where generation halts and what text is returned — the model stops at the first match and the stop string itself is excluded, just like the OpenAI and Anthropic APIs. Use \n for a newline. Everything runs in your browser.

Use \n for a newline, \t for a tab. OpenAI allows up to 4.

Output stops at the first match of "\n\n" (index 10). The stop string itself is not included.
Returned text
Answer: 42

Simulation runs in your browser. Matching is literal and case-sensitive, mirroring the API.

What is Stop Sequence Tester?

A stop sequence is a string that ends generation the moment it appears, and it's one of the most common reasons an LLM response comes back shorter than expected — a plain newline used as a stop, or a delimiter that also occurs inside normal prose, can truncate output early. This tester simulates the behavior exactly: given your candidate output and a list of stop sequences (OpenAI allows up to 4; Anthropic uses stop_sequences), it finds the earliest match, cuts the text there, and shows you the returned string with the stop string removed. Matching is literal and case-sensitive, mirroring the APIs, and you can enter control characters with escapes like \n and \t. It's a fast way to debug 'why did my completion stop there?', to design delimiters that won't collide with content, and to confirm a structured-output format terminates where you intend before you spend tokens on the real call.

How to test a stop sequence

  1. 1Paste the full text the model would generate.
  2. 2Enter one stop sequence per line (use \n for a newline).
  3. 3Read where it truncates — the returned text excludes the matched stop string.

Key Concepts

Stop sequence
A string that halts generation at its first occurrence; not included in the output.
Why output truncates
An unintended match (often \n) cuts the completion early.
SSE streaming
Related: reassemble a streamed response to see where it ended.

Tips & Best Practices

  • ▸A bare newline is the most common accidental stop — check it first when output cuts off early.
  • ▸Pick delimiters that never appear inside your content, like '###' or '<<END>>'.

Frequently Asked Questions

What is a stop sequence?

A stop sequence is a string that tells the API to stop generating as soon as it appears. The model halts at the first match and the stop string itself is not included in the returned text. OpenAI's stop accepts up to 4 strings; Anthropic uses stop_sequences.

Why did my output get truncated early?

A stop sequence probably matched sooner than you expected — often a plain newline (\n) or a token that also appears inside normal text. Paste your output and stops here to see the exact match position and what would be returned.

Are stop sequences case-sensitive?

Yes — matching is literal and case-sensitive, which this tester mirrors. 'END' will not match 'end'.

How do I enter a newline as a stop?

Type \n (backslash-n); the tester converts it to a real newline, as do \t and \r. Each line in the stop box is one separate stop sequence.

Try Next

Cosine Similarity

Compute cosine similarity, dot product, and Euclidean distance between two vectors online. Perfect for debugging LLM embeddings, semantic search, and RAG pipelines. 100% local — vectors never leave your browser.

Related Tools

Reference & Guides