Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Die **KI Platform** ist das zentrale AddOn fuer die Integration von KI-Diensten
| **Google** | `gemini-2.5-flash`, `gemini-2.5-pro` | `text-embedding-004` | `gemini-2.0-flash-exp` | `gemini-2.5-flash`, `gemini-2.5-pro` |
| **Ollama** | `llama3.2`, `mistral`, `deepseek-r1` u.a. | `nomic-embed-text`, `mxbai-embed-large` | - | `llava`, `llama3.2-vision` |

Bei Ollama wird kein API-Key benoetigt, nur die Basis-URL (Standard: `http://localhost:11434`).
Bei Ollama ist nur die Basis-URL Pflicht (Standard: `http://localhost:11434`). Der API-Key ist dort optional: bleibt er leer, wird kein `Authorization`-Header gesendet -- gesetzt, geht er als Bearer-Token mit, wie es ein per Reverse Proxy abgesicherter Ollama-Server erwartet.

## Installation

Expand All @@ -47,7 +47,7 @@ Unter **KI Platform > Profile** werden Profile fuer jeden Anwendungsfall separat
| **Profilname** | Eindeutiger Name, z.B. "Claude Text" oder "DALL-E Bilder" |
| **Typ** | Text/Code, Embeddings, Bildgenerierung oder Bildverstaendnis |
| **Provider** | OpenAI, Anthropic, Google, Ollama oder Replicate |
| **API-Key** | API-Schluessel (wird bei Ollama ausgeblendet) |
| **API-Key** | API-Schluessel; bei Ollama optional (Bearer-Token fuer abgesicherte Server) |
| **Basis-URL** | Nur bei Ollama sichtbar (Standard: `http://localhost:11434`) |
| **Modell** | Wird automatisch passend zum Provider und Typ vorausgefuellt |

Expand Down
7 changes: 5 additions & 2 deletions assets/profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ $(document).on("rex:ready", function () {

// Which provider-specific fields to show/hide
// base_url: only Ollama
// api_key: everything except Ollama
// api_key: all providers -- optional for Ollama (empty means no Authorization
// header, as on a local instance), but needed as a bearer token for an Ollama
// server exposed behind a reverse proxy. OllamaFactory::create() takes it as
// its second argument; see Service::getPlatform().
// image_quality, image_style: only OpenAI (DALL-E specific)
var providerFields = {
openai: { api_key: true, base_url: false, image_quality: true, image_style: true },
anthropic: { api_key: true, base_url: false, image_quality: false, image_style: false },
google: { api_key: true, base_url: false, image_quality: false, image_style: false },
ollama: { api_key: false, base_url: true, image_quality: false, image_style: false },
ollama: { api_key: true, base_url: true, image_quality: false, image_style: false },
};

// Default models per provider+type
Expand Down
2 changes: 1 addition & 1 deletion lang/de_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ai_platform_provider = Provider
ai_platform_please_select = --- Bitte waehlen ---
ai_platform_default = Standard
ai_platform_api_key = API-Key
ai_platform_api_key_notice = Der API-Schluessel des Providers. Bei Ollama nicht erforderlich.
ai_platform_api_key_notice = Der API-Schluessel des Providers. Bei Ollama optional: leer lassen bei einer ungesicherten lokalen Instanz, sonst als Bearer-Token fuer einen abgesicherten Ollama-Server.
ai_platform_base_url = Basis-URL
ai_platform_base_url_notice = Nur fuer Ollama erforderlich (Standard: http://localhost:11434)
ai_platform_model = Modell
Expand Down
2 changes: 1 addition & 1 deletion lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ai_platform_provider = Provider
ai_platform_please_select = --- Please select ---
ai_platform_default = Default
ai_platform_api_key = API Key
ai_platform_api_key_notice = The provider's API key. Not required for Ollama.
ai_platform_api_key_notice = The provider's API key. Optional for Ollama: leave empty for an unsecured local instance, or use it as a bearer token for a secured Ollama server.
ai_platform_base_url = Base URL
ai_platform_base_url_notice = Only required for Ollama (default: http://localhost:11434)
ai_platform_model = Model
Expand Down
1 change: 1 addition & 0 deletions lib/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public function getPlatform(int $profileId): PlatformInterface
'google' => GeminiFactory::create($profile['api_key']),
'ollama' => OllamaFactory::create(
$profile['base_url'] ?: 'http://localhost:11434',
'' !== (string) ($profile['api_key'] ?? '') ? $profile['api_key'] : null,
),
default => throw new rex_exception('Unknown AI provider: ' . $profile['provider']),
};
Expand Down