Oh My Pi
A terminal AI coding agent with support for thinking mode and reasoning effort level mapping.
Overview
Oh My Pi is a terminal AI coding agent that lets you add custom model providers through the models.yml configuration file. It supports thinking mode (reasoning effort), tool calling, and full context management.
- GitHub: https://github.com/can1357/oh-my-pi
- Installation guide: https://github.com/can1357/oh-my-pi#installation
📦 Before You Start
What you need
- Oh My Pi installed (the
ompcommand available) - A working Models Hub Base URL (for this tool, do not add the
/v1suffix when configuring; see the note below) - A working Models Hub API Key (generate it in the console)
- The model name you want to use (such as
claude-sonnet-4-6,gemini-2.5-flash, etc., which must match the model ID in the Models Hub console exactly)
🔑 Step 1: Set the Environment Variable
export MODELSOK_API_KEY="ms_live_your_key"🔧 Step 2: Create the Configuration File
Create ~/.omp/agent/models.yml and add the Models Hub provider:
providers:
modelsok:
baseUrl: https://modelsok.com/v1
api: openai-completions
apiKey: MODELSOK_API_KEY
authHeader: true
models:
- id: claude-sonnet-4-6
name: Claude Sonnet 4.6
reasoning: true
thinking:
minLevel: high
maxLevel: xhigh
mode: effort
input: [text]
contextWindow: 200000
maxTokens: 128000
compat:
supportsDeveloperRole: false
supportsReasoningEffort: true
maxTokensField: max_tokens
reasoningEffortMap:
high: high
xhigh: max
supportsToolChoice: false
requiresReasoningContentForToolCalls: true
requiresAssistantContentForToolCalls: true
extraBody:
thinking:
type: enabled
- id: gemini-2.5-flash
name: Gemini 2.5 Flash
reasoning: false
input: [text]
contextWindow: 1000000
maxTokens: 65536
compat:
supportsDeveloperRole: false
maxTokensField: max_tokensKey configuration notes
| Option | Description |
|---|---|
baseUrl | The Models Hub Base URL. Write /v1 per the Models Hub standard (Oh My Pi handles path concatenation internally) |
authHeader: true | Sends Authorization: Bearer $MODELSOK_API_KEY |
supportsDeveloperRole: false | Sends the system prompt with the system role |
maxTokensField: max_tokens | Uses max_tokens as the output limit field |
supportsToolChoice: false | The tool_choice parameter is not accepted in thinking mode |
requiresReasoningContentForToolCalls: true | reasoning_content must be preserved in the history messages of a tool call conversation |
requiresAssistantContentForToolCalls: true | Ensures the content field of a tool call message is not empty |
Important
The compat field in models.yml is replaced as a whole block; it is not merged with the built-in entries. You must write out all the fields you need—any missing fields are treated as their default values.
✅ Step 3: Launch and Verify
Go to your project directory and launch with the parameter:
cd /path/to/your-project
omp --model modelsok/claude-sonnet-4-6When you need faster responses, switch to a non-reasoning model:
omp --model modelsok/gemini-2.5-flashInside Oh My Pi, press Ctrl+L at any time or type /model to switch models.
❓ FAQ
| Issue | Solution |
|---|---|
| Provider not found on startup | Check that the path ~/.omp/agent/models.yml is correct |
| 401 Unauthorized | Confirm that MODELSOK_API_KEY is exported in the current shell |
| Tool call errors with a reasoning model | Confirm that requiresReasoningContentForToolCalls: true is enabled |
| Abnormal behavior after switching models | For non-reasoning models, disable reasoning: true and extraBody.thinking |