-
Notifications
You must be signed in to change notification settings - Fork 0
OpenAI Endpoint Guide
This guide walks you through setting up a local translation LLM on your computer using Ollama and configuring it as an OpenAI-Compatible Endpoint in Aibou.
When Aibou sends translation requests—especially batch translations—it uses a specific delimiter (|||) to separate multiple lines of text in a single request.
Without explicit instructions, general chat AI models may try to answer conversationally (e.g., "Here is your translation: ...") or strip out the required formatting delimiters. We will set up a custom Modelfile in Ollama to instruct Gemma 4 to act strictly as a translation engine that honors Aibou's syntax.
- Download and install Ollama from https://ollama.com/.
- Once installed, open your terminal (Command Prompt, PowerShell, or macOS/Linux Terminal) to verify it is working:
ollama -v
To configure Gemma 4 with the required translation system prompt, create a custom model definition:
- Create a new text file anywhere on your computer (for example on your Desktop or inside a dedicated project folder) and name it simply
Modelfile(no file extension). - Paste the following configuration into the file:
FROM gemma4
SYSTEM """
You are a direct professional Japanese-to-English translation engine.
Your task is to translate the text sent by the user directly into fluent English.
Strict Rules:
1. ONLY output the direct English translation. Do NOT include explanations, greetings, introduction, or conversational filler of any kind.
2. If the input text contains multiple segments separated by the '|||' delimiter, you MUST preserve the exact same '|||' delimiter between your translated segments in the output. Do not add spaces or formatting around '|||'.
3. Maintain the exact same number of separated segments as provided in the input.
"""- Open a terminal in the folder where you saved your
Modelfileand run the following command to download Gemma 4 and build your translation model:(This creates a custom model namedollama create aibou-gemma4 -f Modelfile
aibou-gemma4pre-configured with Aibou's translation rules).
By default, Ollama only accepts connections from localhost (127.0.0.1). If you are running Aibou on an Android device connected to the same Wi-Fi network as your PC, you need to instruct Ollama to listen to incoming network requests:
Set the host environment variable and run Ollama:
$env:OLLAMA_HOST="0.0.0.0"
ollama serve(Tip: To make this permanent on Windows, add OLLAMA_HOST with a value of 0.0.0.0 under System Environment Variables and restart your PC/Ollama app).
OLLAMA_HOST=0.0.0.0 ollama serveYour phone needs your PC's local Wi-Fi IP address to communicate with Ollama:
-
Windows: Open Command Prompt / PowerShell and run
ipconfig. Look for the IPv4 Address under your active Ethernet/Wi-Fi adapter (e.g.,192.168.1.50). -
macOS/Linux: Run
ifconfigorip a.
Open the Aibou App on your Android device and navigate to your API configurations:
- Select OpenAI Endpoint as your translation provider.
- Enter the following details:
-
API URL:
http://<YOUR-PC-IP-ADDRESS>:11434/v1/chat/completions
(Example:http://192.168.1.50:11434/v1/chat/completions) -
API Key:
ollama
(Ollama ignores the API key, but standard OpenAI clients require a non-empty string here). -
Model Name:
aibou-gemma4
-
API URL:
- Tap Save / Test to activate the endpoint!