Skip to content

feat: honour LLMMAN_HOST and document using Gollama with llmman - #239

Open
ericcurtin wants to merge 1 commit into
sammcj:mainfrom
ericcurtin:llmman
Open

ericcurtin wants to merge 1 commit into
sammcj:mainfrom
ericcurtin:llmman

Conversation

@ericcurtin

@ericcurtin ericcurtin commented Sep 4, 2026

Copy link
Copy Markdown

llmman is a local model runner that serves the Ollama API on port 17434; Gollama already works against it when pointed at that URL.

  • config/config.go: getAPIUrl() falls back to LLMMAN_HOST when OLLAMA_HOST is unset (same scheme handling, folded into a two-entry loop). OLLAMA_API_URL and OLLAMA_HOST keep precedence; default URL unchanged.
  • config/config_test.go: new TestLoadConfig case for LLMMAN_HOST; env var is unset before each case.
  • README.md: short "Using with llmman" section, noting Enter (run) shells out to the ollama CLI and that Modelfile editing and --ollama-dir rely on Ollama's store.

Testing: gofmt -l ., go build ./..., go vet ./..., go test ./... all pass, including the new LLMMAN_HOST case.

AI-assisted, reviewed before submitting.

Copilot AI lite review requested due to automatic review settings September 4, 2026 14:29
@ericcurtin
ericcurtin requested a review from sammcj as a code owner September 4, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A precedence change was introduced but isn’t fully covered by tests (and the README wording should reflect the full env-var precedence).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR makes Gollama easier to use with llmman by adding a new environment-variable fallback for the API host and documenting the intended workflow, while preserving existing Ollama precedence and defaults.

Changes:

  • Update API URL resolution to fall back to LLMMAN_HOST when OLLAMA_HOST is unset (after OLLAMA_API_URL).
  • Add a TestLoadConfig case covering LLMMAN_HOST.
  • Document how to point Gollama at llmman and which features/endpoints are expected to work.
File summaries
File Description
config/config.go Adds LLMMAN_HOST fallback in getAPIUrl() while keeping OLLAMA_API_URL / OLLAMA_HOST precedence.
config/config_test.go Adds a new LLMMAN_HOST test case and ensures env cleanup includes LLMMAN_HOST.
README.md Documents running Gollama against llmman via -h or LLMMAN_HOST, plus known limitations.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread config/config_test.go
Comment on lines +156 to 157
},
{
Comment thread README.md

#### Using with llmman

[llmman](https://github.com/llmmanorg/llmman) is a local model runner that serves the Ollama API (alongside OpenAI- and Anthropic-compatible ones) on port 17434. Point Gollama at it with `-h`, or set `LLMMAN_HOST` (used when `OLLAMA_HOST` is not set):
Comment thread config/config.go
for _, env := range []string{"OLLAMA_HOST", "LLMMAN_HOST"} {
if host := os.Getenv(env); host != "" {
// Check if the host already starts with http:// or https://
if len(host) >= 7 && host[:7] == "http://" || len(host) >= 8 && host[:8] == "https://" {
llmman (https://github.com/llmmanorg/llmman) serves the Ollama API on
port 17434, so Gollama already works against it when given the URL.

Fall back to LLMMAN_HOST when OLLAMA_HOST is unset so llmman-only users
need not set Ollama's variable or pass -h. OLLAMA_HOST keeps precedence.
Add a config test and a short README section noting what still needs
Ollama (run via the ollama CLI, Modelfile editing, --ollama-dir).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Changes are small, backward-compatible, and include a targeted test case for the new LLMMAN_HOST behavior.

Review details

Suppressed comments (2)

config/config.go:64

  • The scheme check relies on operator precedence; adding parentheses makes the intent unambiguous and reduces risk of accidental logic changes during future edits.
			if len(host) >= 7 && host[:7] == "http://" || len(host) >= 8 && host[:8] == "https://" {

README.md:178

  • This sentence says LLMMAN_HOST is used when OLLAMA_HOST is not set, but OLLAMA_API_URL also takes precedence; consider mentioning both to avoid confusing readers who already use OLLAMA_API_URL.
[llmman](https://github.com/llmmanorg/llmman) is a local model runner that serves the Ollama API (alongside OpenAI- and Anthropic-compatible ones) on port 17434. Point Gollama at it with `-h`, or set `LLMMAN_HOST` (used when `OLLAMA_HOST` is not set):
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread config/config.go
Comment on lines 55 to +56
// getAPIUrl determines the API URL based on environment variables.
// OLLAMA_HOST takes precedence over LLMMAN_HOST (llmman serves the Ollama API on 17434).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants