Skip to content

Add Ollama local Model support - #197

Open
WaterS-MoYu wants to merge 13 commits into
ramjke:masterfrom
WaterS-MoYu:master
Open

Add Ollama local Model support#197
WaterS-MoYu wants to merge 13 commits into
ramjke:masterfrom
WaterS-MoYu:master

Conversation

@WaterS-MoYu

@WaterS-MoYu WaterS-MoYu commented Mar 25, 2025

Copy link
Copy Markdown

Add Ollama local model name support, users must install ollama on their PC and add folder path (which contains ollama.exe) to PATH, then run "ollama run " to install any model. Input in translumo languages setting--OllamaModel and choose translator to "LocalOllama"

@WaterS-MoYu WaterS-MoYu changed the title Add Ollama llama3:latest support Add Ollama local Model support Mar 25, 2025
Chaobs pushed a commit to Chaobs/Translumo-LLM that referenced this pull request Jul 23, 2026
Add Ollama as a built-in LLM provider so users can run translations against
a local Ollama instance without configuring a Custom provider. Unlike the
upstream PR ramjke/Translumo#197 (which used the legacy /api/generate
endpoint with a hardcoded prompt), this reuses the existing LlmTranslator
pipeline (professional system prompt, retry, parsing, encryption) over
Ollama's OpenAI-compatible /v1/chat/completions endpoint.

- LlmProvider: add Ollama = 10.
- LlmProviderPresets: Ollama preset (http://localhost:11434/v1/chat/completions,
  llama3, OpenAI style).
- LlmModelCatalog: 10 common Ollama models (llama3/3.1/3.2, qwen2.5, mistral,
  gemma2, phi3, deepseek-r1, ...).
- LlmConfiguration: add RequiresApiKey (Ollama does not need a key).
- LlmTranslator: skip the API key check and the Authorization header for
  providers that do not require a key.
- Tests: https-assertion Ollama http exception, ApiStyle/FirstModel theory
  additions, RequiresApiKey tests.

Also reorder the LLM provider dropdown so Custom is always last and Ollama
sits just above it (LanguagesSettingsViewModel.ProviderDisplayOrder). The
enum values are intentionally left unchanged to keep saved configs
deserializable.

Verified: 0 error/0 warning, 58 tests pass.
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.

1 participant