Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

bug: The "stop word" feature is not working #2016

@LeVinhGithub

Description

@LeVinhGithub

Cortex version

1.0.10

Describe the issue and expected behaviour

When user input the stop word in the Inference setting, it does not stop the response when the stop word displays

Steps to Reproduce

  1. Open Jan
  2. Select any model
  3. Open Inference Setting > input Stop word > add to
  4. Chat with question How to do something?

Issue:

  • The response show to in the answer but it did not stop the response when to is displayed

Screenshots / Logs

Image

app.log

cortex.log

{
  "messages": [
    {
      "role": "system",
      "content": "give short answer in 1 sentence"
    },
    {
      "role": "user",
      "content": "how to write a poem"
    }
  ],
  "model": "llama3.2-1b-instruct",
  "stream": true,
  "engine": "llama-cpp",
  "frequency_penalty": 0,
  "max_tokens": 8192,
  "presence_penalty": 0,
  "stop": [
    "<|end_of_text|>",
    "<|eot_id|>",
    "<|eom_id|>",
    "to"
  ],
  "temperature": 0.7,
  "top_p": 0.95
}
for http://127.0.0.1:39291/v1/chat/completions
{
  "created_at": 1740363450,
  "id": "01JMTVXJ3YH3GVPH4C3C2S851B",
  "metadata": {
    "title": "Writing a Poem Crafting Verse with Skill and Creative Expression",
    "updated_at": 1740363909437,
    "lastMessage": "To write a poem, start by brainstorming ideas and themes, then use sensory language, metaphors, similes, and other literary devices to create vivid imagery and expression."
  },
  "object": "thread",
  "updated": 1740363906.744,
  "title": "Writing a Poem Crafting Verse with Skill and Creative Expression"
}

for http://127.0.0.1:39291/v1/threads/01JMTVXJ3YH3GVPH4C3C2S851B
Request Method:
PATCH
Status Code:
200 OK

What is your OS?

  • Windows
  • Mac Silicon
  • Mac Intel
  • Linux / Ubuntu

What engine are you running?

  • cortex.llamacpp (default)
  • cortex.tensorrt-llm (Nvidia GPUs)
  • cortex.onnx (NPUs, DirectML)

Hardware Specs eg OS version, GPU

M2

Metadata

Metadata

Assignees

Labels

type: bugSomething isn't working

Type

Projects

Status

Eng Planning

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions