Repository navigation
Add the "Custom AI" engine for a user's own OpenAI-compatible server - #5
Closed
marufmoinuddin wants to merge 3 commits into
Closed
marufmoinuddin wants to merge 3 commits into
marufmoinuddin wants to merge 3 commits into
Conversation
marufmoinuddin
force-pushed
the
feature/custom-openai-endpoint
branch
2 times, most recently
from
October 25, 2026 05:20
c4a8378 to
e5bdfc9
Compare
Owner
|
Thank you for this. Please validate the address as https before it can be saved. |
The user names the server's base address and the model in Settings and pastes their key; the app sends a plain text Chat Completions request to <base>/chat/completions and reads the text on the device, so no image ever leaves the phone. - EngineId.CUSTOM (offered, user key, no default model): the user must name both the model and the address. - CustomEndpoint (core:model) reduces an address to its base: a pasted …/chat/completions is stripped, the path the user wrote is kept, no version segment is ever appended, and HTTPS is required. - CustomOpenAiEngine (core:engine) is a standalone LlmEngine: text only, and a server that refuses the optional temperature is asked once more without it. - The base URL lives in DataStore (an address, not a secret); the key stays in the existing SecureKeyStore. - The key sheet gains an address field for this engine only, and one save callback carries the key, the model and the address through a single ViewModel coroutine. Existing engines are untouched.
marufmoinuddin
force-pushed
the
feature/custom-openai-endpoint
branch
from
October 30, 2026 10:28
e5bdfc9 to
29ed76a
Compare
This was referenced Oct 30, 2026
Owner
|
Thank you, marufmoinuddin! This work has landed in main through #25, rebased onto the current main. Your commits are kept with you as their author:
On top of them, #25 also includes your tolerant-parsing commit from #17 and a hardening pass: engine HTTP with no Thanks again for building it! |
Owner
|
Closing This |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Adds a Custom AI translation engine: a user names their own OpenAI-compatible server in Settings and pastes
their key, and the app sends a plain text Chat Completions request to
<your address>/chat/completionsand readsthe text back on the device, so no image ever leaves the phone.
The address must be HTTPS. A pasted
…/chat/completionsaddress is accepted as it is; no/v1is added for you.The engine is registered directly after Gemini in the registry, so it appears in the engine picker in the same place
as every other provider.
How it was checked
./gradlew clean assembleDebug testDebugUnitTest :core:model:testpasses locally: 398 unit tests in 61classes, 0 failures / 0 errors, and the debug APK builds.
Authorization: Bearerheader, the reply parsing and the typed failure for each error are covered.engine was exercised; the address is accepted, the key is stored, and the request is sent and the reply read back
on the device, with no image leaving the phone.
Checklist
main, and the branch is up to date with it../gradlew assembleDebug testDebugUnitTest :core:model:testpasses locally.docs/TESTING.md.strings.xml(see CONTRIBUTING).The new dialog reuses
core/ui'sStickerDialogandTextAction, and every colour it uses comes fromTokens; the engine tile tint follows the existing provider-palette pattern inEnginePicker.PIPELINE_VERSION; schema changes bumpPanelglassDb.version.Neither applies: no rendering or schema change.
docs/MEMORY_USAGE.md).Not applicable: this does not touch model loading or backends.
## [Unreleased]inCHANGELOG.md.