[GH-ISSUE #3885] MESSAGE dont work in REST API #48919

Open
opened 2026-04-28 10:04:02 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Rikhart on GitHub (Apr 24, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3885

What is the issue?

Hi i am using your model file definition to train an AI, but when i use the rest api the knoledgment passed througth the MESSAGE structure my AI dont work, what i am missing?

Example of my Model file

FROM llama2
SYSTEM """Eres un asistente que ayuda a los clientes de la empresa Octano, dentro de la empresa se te ha asignado la atención al cliente,  debes responder con respuestas cortas y claras. La conversación solo la debes dar en el lenguaje español."""
MESSAGE user """¿Como te llamas?"""
MESSAGE assistant """Mi nombre es Octavio, soy el asistente virtual de Octano, estoy aquí para ayudarte con tus consultas."""
MESSAGE user """¿Que servicios brindan?"""
MESSAGE assistant """En Octano ayudamos a las personas a aprender programación a traves de nuestros cursos y webinars."""

Additional i am using ollama-js to generate the Model file and then througth the method ollama.create i am loading

await ollama.create({ model: 'octavio', modelfile: Modelfile });

The problem is when i using the rest api, the ai only use the SYSTEM information, all the training passed about the MESSAGE parameter is forgeted.

All the information passed with the MESSAGE structure only work in the terminal when i use the :

ollama run octavio

When i stay in the terminal and chat there my ai works well, but not when use the rest api.

Thanks for your help

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.1.32

Originally created by @Rikhart on GitHub (Apr 24, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3885 ### What is the issue? Hi i am using your model file definition to train an AI, but when i use the rest api the knoledgment passed througth the MESSAGE structure my AI dont work, what i am missing? Example of my Model file ```modelfile FROM llama2 SYSTEM """Eres un asistente que ayuda a los clientes de la empresa Octano, dentro de la empresa se te ha asignado la atención al cliente, debes responder con respuestas cortas y claras. La conversación solo la debes dar en el lenguaje español.""" MESSAGE user """¿Como te llamas?""" MESSAGE assistant """Mi nombre es Octavio, soy el asistente virtual de Octano, estoy aquí para ayudarte con tus consultas.""" MESSAGE user """¿Que servicios brindan?""" MESSAGE assistant """En Octano ayudamos a las personas a aprender programación a traves de nuestros cursos y webinars.""" ``` Additional i am using ollama-js to generate the Model file and then througth the method ollama.create i am loading ```js await ollama.create({ model: 'octavio', modelfile: Modelfile }); ``` The problem is when i using the rest api, the ai only use the SYSTEM information, all the training passed about the MESSAGE parameter is forgeted. All the information passed with the MESSAGE structure only work in the terminal when i use the : ``` ollama run octavio ``` When i stay in the terminal and chat there my ai works well, but not when use the rest api. Thanks for your help ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.1.32
GiteaMirror added the bugapi labels 2026-04-28 10:04:09 -05:00
Author
Owner

@Azarattum commented on GitHub (Jul 26, 2024):

Is there any workaround other than passing all the messages from the client (since there could be lots of them)?

<!-- gh-comment-id:2251904930 --> @Azarattum commented on GitHub (Jul 26, 2024): Is there any workaround other than passing all the messages from the client (since there could be lots of them)?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#48919