Skip to content

Added Openrouter Support & chore: update .gitignore and Docker configurations - #979

Open
Capp3 wants to merge 1 commit into
icereed:mainfrom
Capp3:main
Open

Added Openrouter Support & chore: update .gitignore and Docker configurations#979
Capp3 wants to merge 1 commit into
icereed:mainfrom
Capp3:main

Conversation

@Capp3

@Capp3 Capp3 commented May 28, 2026

Copy link
Copy Markdown
  • Added *.override.yml to .gitignore to exclude override files from version control.
  • Removed port mapping from docker-compose.yml to simplify service configuration. (and remove quick pull port conflicts, this could be handled different)
  • Updated Dockerfile to install packages without pinned versions for better flexibility.
  • Enhanced OpenAI client creation in main.go and llm_provider.go to conditionally append base URL from environment variable.

Summary by CodeRabbit

Release Notes

  • Configuration

    • OpenAI client now supports custom base URL via environment variable
    • Removed port mapping for application in Docker Compose
  • Chores

    • Updated Alpine package installation approach
    • Added ignore pattern for override configuration files

Review Change Stack

- Added *.override.yml to .gitignore to exclude override files from version control.
- Removed port mapping from docker-compose.yml to simplify service configuration.
- Updated Dockerfile to install packages without pinned versions for better flexibility.
- Enhanced OpenAI client creation in main.go and llm_provider.go to conditionally append base URL from environment variable.
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fb25401c-525f-4c1f-a9e9-cf57bd41c444

📥 Commits

Reviewing files that changed from the base of the PR and between 94c8428 and 0e48e7f.

📒 Files selected for processing (5)
  • .gitignore
  • Dockerfile
  • docker-compose.yml
  • main.go
  • ocr/llm_provider.go
💤 Files with no reviewable changes (1)
  • docker-compose.yml

📝 Walkthrough

Walkthrough

This PR adds conditional OpenAI base URL support to the LLM client initialization, allowing configuration overrides for non-Azure OpenAI deployments. It also updates Docker and compose configurations by unpinning Alpine package versions, removing the port binding from the app service, and adding a git ignore rule for override configuration files.

Changes

OpenAI Base URL Configuration

Layer / File(s) Summary
OpenAI conditional base URL support
ocr/llm_provider.go, main.go
createOpenAIClient builds options via a slice and conditionally appends WithBaseURL when OPENAI_BASE_URL is set; createLLM and createVisionLLM now apply the same conditional base URL logic for non-Azure OpenAI configurations.

Infrastructure and Deployment Updates

Layer / File(s) Summary
Docker and deployment configuration updates
Dockerfile, docker-compose.yml, .gitignore
Builder stage installs gcc, musl-dev, mupdf, mupdf-dev, and sed without version pinning; app service no longer publishes port 8080; git ignore adds pattern for *.override.yml files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops through configs with glee,
OpenAI's base URLs now flow so free,
Docker drops pins, no versions to see,
Ports unpublished, simpler to be! 🐰

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions two main areas (Openrouter support and Docker/gitignore updates) but the changeset shows no Openrouter-specific implementation—only environment variable flexibility for OpenAI base URLs. Revise the title to accurately reflect the actual changes, such as 'Refactor OpenAI client configuration and update build configurations' or 'Add conditional base URL support for OpenAI and update Docker configs'.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

icereed added a commit that referenced this pull request Sep 10, 2026
Six open issues (#864, #903, #908, #979, #1041, #830) request providers
that already work today via LLM_PROVIDER=openai plus OPENAI_BASE_URL. One
of them arrived as a PR adding a hardcoded per-vendor branch that was
functionally identical to those two settings — and strictly less capable,
having dropped the Azure and base-URL handling the shared path has.

That many duplicate requests is a documentation failure, not six missing
features: OPENAI_BASE_URL was mentioned only in one table row, so nobody
looking for "does it support X" found it.

Adds docs/openai_compatible_providers.md with copy-pasteable configs for
OpenRouter, LM Studio, vLLM, LiteLLM, llama.cpp and Azure, the three
things people get wrong (missing /v1, vendor-specific model names,
placeholder keys for local servers), a troubleshooting section mapping
the recurring errors to their causes (#1035, #791, #862, #1003), and the
rationale for not adding per-vendor branches.

Surfaces it from a new README section and the env-var table, and notes
that Ollama should use its native provider rather than the shim, since
the shim exposes neither OLLAMA_CONTEXT_LENGTH nor OLLAMA_THINK.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

@icereed icereed left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

🤖 Automated review — produced by Claude Code running in the maintainer's repo checkout and posted under the maintainer's account, not hand-written by them.

Declining the OpenRouter provider branch — because OpenRouter already works, and has all along:

environment:
  LLM_PROVIDER: "openai"
  OPENAI_BASE_URL: "https://openrouter.ai/api/v1"
  OPENAI_API_KEY: "sk-or-..."
  LLM_MODEL: "anthropic/claude-sonnet-4-5"

paperless-gpt even already sends an X-Title: paperless-gpt header, which is the attribution header OpenRouter uses for its rankings.

That five separate issues and PRs asked for providers that already ship (#864, #903, #908, #1041, #830) is a documentation failure on our side, not five missing features — OPENAI_BASE_URL was mentioned only in one row of a 100-row table. #1060 fixes that with docs/openai_compatible_providers.md, where OpenRouter is the first worked example.

Two other things about this PR regardless of the provider question:

  • It's based on your main and conflicts now; main has moved a lot since May.
  • It bundles unrelated .gitignore and Docker configuration changes with the provider addition. Those would need to be a separate PR anyway so they can be judged on their own — if any of them fix a real problem you hit, please do open that separately, it's easier to say yes to.

Closing recommendation rather than a close, in case the Docker changes are worth keeping.

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