[GH-ISSUE #8339] GIN_MODE not able to set to release #5346

Closed
opened 2026-04-12 16:32:44 -05:00 by GiteaMirror · 16 comments
Owner

Originally created by @leobenkel on GitHub (Jan 7, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8339

What is the issue?

Hello,

in v0.5.4 , I am not able to set the GIN_MODE to release:

I have

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.

in the log.

But in my env:

GIN_MODE=release

it is running in a docker image:

ARG GIN_MODE=debug
ENV GIN_MODE=$GIN_MODE

OS

Docker

GPU

Nvidia

CPU

Intel

Ollama version

0.5.4

Originally created by @leobenkel on GitHub (Jan 7, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8339 ### What is the issue? Hello, in `v0.5.4` , I am not able to set the `GIN_MODE` to release: I have ```log [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. ``` in the log. But in my `env`: ```.env GIN_MODE=release ``` it is running in a docker image: ```Dockerfile ARG GIN_MODE=debug ENV GIN_MODE=$GIN_MODE ``` ### OS Docker ### GPU Nvidia ### CPU Intel ### Ollama version 0.5.4
GiteaMirror added the bug label 2026-04-12 16:32:44 -05:00
Author
Owner

@rick-github commented on GitHub (Jan 7, 2025):

ARG GIN_MODE=debug
ENV GIN_MODE=$GIN_MODE

This sets GIN_MODE at build time for the docker image. Have you set it at run time? How do you start the docker image?

<!-- gh-comment-id:2576244697 --> @rick-github commented on GitHub (Jan 7, 2025): > ARG GIN_MODE=debug > ENV GIN_MODE=$GIN_MODE This sets `GIN_MODE` at build time for the docker image. Have you set it at run time? How do you start the docker image?
Author
Owner

@leobenkel commented on GitHub (Jan 8, 2025):

when i run the docker image with the ollama serve as entry point. And then, ssh into the container and run env , I see the GIN_MODE=release

<!-- gh-comment-id:2577211637 --> @leobenkel commented on GitHub (Jan 8, 2025): when i `run` the docker image with the `ollama serve` as entry point. And then, `ssh` into the container and run `env` , I see the `GIN_MODE=release`
Author
Owner

@rick-github commented on GitHub (Jan 8, 2025):

Looks like it's not run-time configurable: https://github.com/ollama/ollama/commit/95187d7e1. The docker release is a debug build (ollama version is 0.5.4-0-g2ddc32d-dirty).

<!-- gh-comment-id:2577630389 --> @rick-github commented on GitHub (Jan 8, 2025): Looks like it's not run-time configurable: https://github.com/ollama/ollama/commit/95187d7e1. The docker release is a debug build (`ollama version is 0.5.4-0-g2ddc32d-dirty`).
Author
Owner

@leobenkel commented on GitHub (Jan 8, 2025):

ok so there is no way to change it i guess ...

<!-- gh-comment-id:2577774336 --> @leobenkel commented on GitHub (Jan 8, 2025): ok so there is no way to change it i guess ...
Author
Owner

@github12101 commented on GitHub (Jan 25, 2025):

Also affected by this. Using ollama on Linux (no docker, latest version 0.5.7. Environment variable does nothing.

<!-- gh-comment-id:2613970469 --> @github12101 commented on GitHub (Jan 25, 2025): Also affected by this. Using ollama on Linux (no docker, latest version 0.5.7. Environment variable does nothing.
Author
Owner

@rick-github commented on GitHub (Jan 25, 2025):

It just prints debugging information. Ignore it.

<!-- gh-comment-id:2613971996 --> @rick-github commented on GitHub (Jan 25, 2025): It just prints debugging information. Ignore it.
Author
Owner

@leobenkel commented on GitHub (Jan 27, 2025):

It just prints debugging information. Ignore it.

Those information can be an issue for some regulations

<!-- gh-comment-id:2616198946 --> @leobenkel commented on GitHub (Jan 27, 2025): > It just prints debugging information. Ignore it. Those information can be an issue for some regulations
Author
Owner

@github12101 commented on GitHub (Jan 27, 2025):

It just prints debugging information. Ignore it.

Is that so? It does not slow down ollama?
We should unset GIN_MODE variable?

<!-- gh-comment-id:2617135273 --> @github12101 commented on GitHub (Jan 27, 2025): > It just prints debugging information. Ignore it. Is that so? It does not slow down ollama? We should unset GIN_MODE variable?
Author
Owner

@rick-github commented on GitHub (Jan 27, 2025):

GIN_MODE debug has no effect on inference.

<!-- gh-comment-id:2617174520 --> @rick-github commented on GitHub (Jan 27, 2025): GIN_MODE debug has no effect on inference.
Author
Owner

@leobenkel commented on GitHub (Jan 28, 2025):

GIN_MODE debug has no effect on inference.

it has impact on regulations

<!-- gh-comment-id:2618452225 --> @leobenkel commented on GitHub (Jan 28, 2025): > GIN_MODE debug has no effect on inference. it has impact on regulations
Author
Owner

@rick-github commented on GitHub (Jan 28, 2025):

All GIN-debug does is emit the endpoints. What regulations in which country does this impact?

<!-- gh-comment-id:2618459116 --> @rick-github commented on GitHub (Jan 28, 2025): All GIN-debug does is emit the endpoints. What regulations in which country does this impact?
Author
Owner

@leobenkel commented on GitHub (Jan 28, 2025):

All GIN-debug does is emit the endpoints. What regulations in which country does this impact?

is that all it does? you dont see the content of the query or the response ?

<!-- gh-comment-id:2618878167 --> @leobenkel commented on GitHub (Jan 28, 2025): > All GIN-debug does is emit the endpoints. What regulations in which country does this impact? is that all it does? you dont see the content of the query or the response ?
Author
Owner

@rick-github commented on GitHub (Jan 28, 2025):

Query is logged if OLLAMA_DEBUG is set. Response is not logged.

<!-- gh-comment-id:2618881970 --> @rick-github commented on GitHub (Jan 28, 2025): Query is logged if `OLLAMA_DEBUG` is set. Response is not logged.
Author
Owner

@alirezaghey commented on GitHub (Feb 5, 2025):

had the same problem, kinda confusing the output advising to set it to release but not recognizing it.

<!-- gh-comment-id:2636349184 --> @alirezaghey commented on GitHub (Feb 5, 2025): had the same problem, kinda confusing the output advising to set it to `release` but not recognizing it.
Author
Owner

@benemorius commented on GitHub (Aug 13, 2025):

Even though the workaround is "do nothing", it still took me time to find this thread with the workaround. A proper fix would be greatly appreciated.

<!-- gh-comment-id:3185478564 --> @benemorius commented on GitHub (Aug 13, 2025): Even though the workaround is "do nothing", it still took me time to find this thread with the workaround. A proper fix would be greatly appreciated.
Author
Owner

@arunskurian commented on GitHub (Oct 14, 2025):

PR#12616 may address this.

<!-- gh-comment-id:3403376109 --> @arunskurian commented on GitHub (Oct 14, 2025): [PR#12616](https://github.com/ollama/ollama/pull/12616) may address this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5346