[GH-ISSUE #8682] GIN mode is hard-coded to debug mode #5625

Closed
opened 2026-04-12 16:54:14 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @yoonsio on GitHub (Jan 30, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8682

Originally assigned to: @mxyng on GitHub.

What is the issue?

Gin mode is hard-coded to gin.DebugMode and ignores GIN_MODE environment variable.
The server always displays this log on start up.

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

OS

No response

GPU

No response

CPU

No response

Ollama version

master

Originally created by @yoonsio on GitHub (Jan 30, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8682 Originally assigned to: @mxyng on GitHub. ### What is the issue? Gin mode is hard-coded to gin.DebugMode and ignores `GIN_MODE` environment variable. The server always displays this log on start up. ``` [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version master
GiteaMirror added the bug label 2026-04-12 16:54:14 -05:00
Author
Owner

@yoonsio commented on GitHub (Jan 30, 2025):

PR: https://github.com/ollama/ollama/pull/8681

<!-- gh-comment-id:2623293595 --> @yoonsio commented on GitHub (Jan 30, 2025): PR: https://github.com/ollama/ollama/pull/8681
Author
Owner

@pdevine commented on GitHub (Jan 30, 2025):

I think this may be fixed now w/ the recent build changes.

<!-- gh-comment-id:2625304478 --> @pdevine commented on GitHub (Jan 30, 2025): I _think_ this may be fixed now w/ the recent build changes.
Author
Owner

@mxyng commented on GitHub (Jan 30, 2025):

GIN_MODE is set to debug in code for development. It's set to release in for release builds through Go's -ldflags=-X option, e.g. here. There was a bug in 0.5.7 which did not set this flag correctly which should now be fixed.

If Ollama is built from source, it'll be in debug mode. If you want to set it to release, you can use the method described above. Additionally GIN_MODE has little impact on Ollama outside of the debug logs you mentioned.

<!-- gh-comment-id:2625321718 --> @mxyng commented on GitHub (Jan 30, 2025): `GIN_MODE` is set to `debug` in code for development. It's set to `release` in for release builds through Go's `-ldflags=-X` option, e.g. [here](https://github.com/ollama/ollama/blob/main/.github/workflows/release.yaml#L19). There was a bug in 0.5.7 which did not set this flag correctly which should now be fixed. If Ollama is built from source, it'll be in `debug` mode. If you want to set it to release, you can use the method described above. Additionally `GIN_MODE` has little impact on Ollama outside of the debug logs you mentioned.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5625