-
Notifications
You must be signed in to change notification settings - Fork 682
feat(integrations): add Oh My Pi (omp) client integration #1140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dd65711
3a53748
32a409a
6ac2a16
e80d6f7
ee5e195
97eb310
4537997
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| --- | ||
| title: Oh My Pi | ||
| description: Use any routed model from Oh My Pi (omp) — ocx export prints a custom provider block for omp's ~/.omp/agent/models.yml, wired to the running proxy. | ||
| --- | ||
|
|
||
| Oh My Pi (`omp`) reads custom providers from `~/.omp/agent/models.yml`, so | ||
| opencodex does not launch it. Instead, `ocx export` serializes the `opencodex` | ||
| provider block — base URL, model list, and the env reference omp interpolates — | ||
| and you merge it into that file. | ||
|
|
||
| ## Quickstart | ||
|
|
||
| Start the proxy, then print the config: | ||
|
|
||
| ```bash | ||
| ocx start | ||
| ocx export --client omp | ||
| ``` | ||
|
|
||
| The output leads with the YAML, then prints the destination path, the merge | ||
| warning, the env export line, and how many models carry authoritative context | ||
| limits. | ||
|
|
||
| ```yaml | ||
| providers: | ||
| opencodex: | ||
| baseUrl: http://127.0.0.1:10100/v1 | ||
| api: openai-completions | ||
| apiKey: "$OPENCODEX_OMP_API_KEY" | ||
| models: | ||
| - id: anthropic/claude-opus-5 | ||
| name: "Claude Opus 5 (anthropic)" | ||
| input: | ||
| - text | ||
| contextWindow: 200000 | ||
| maxTokens: 32000 | ||
| ``` | ||
|
|
||
| `api: openai-completions` selects omp's OpenAI-compatible adapter, which talks | ||
| to the proxy's `/v1` surface. `$OPENCODEX_OMP_API_KEY` is only omp's local | ||
| provider key for the `opencodex` entry — it is not an opencodex OAuth or | ||
| access-token credential, and opencodex never sees its value. | ||
|
Comment on lines
+39
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 3 'openai-chat|openai-completions|Chat Completions' \
src/clients/config-export.ts \
docs-site/src/content/docs/reference/adapters.md \
docs-site/src/content/docs/guides/providers.md \
docs-site/src/content/docs/guides/oh-my-pi.mdRepository: lidge-jun/opencodex Length of output: 15601 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- adapter reference relevant section ---'
sed -n '1,80p' docs-site/src/content/docs/reference/adapters.md | cat -n
printf '%s\n' '--- config-export OMP dialect/use sites ---'
sed -n '130,190p' src/clients/config-export.ts | cat -n
sed -n '900,995p' src/clients/config-export.ts | cat -n
printf '%s\n' '--- semantic check for wire format mentions in OMP provider docs ---'
python3 - <<'PY'
from pathlib import Path
paths = [
Path("src/clients/config-export.ts"),
Path("docs-site/src/content/docs/reference/adapters.md"),
Path("docs-site/src/content/docs/guides/providers.md"),
Path("docs-site/src/content/docs/guides/oh-my-pi.md"),
]
for p in paths:
text = p.read_text()
print(p, {
"api:openai-completions": 'api: "openai-completions"' in text or "api: openai-completions" in text,
"openai-chat": text.count("`openai-chat`"),
"Chat Completions": text.count("Chat Completions"),
"COMPLETIONS": text.count("/chat/completions"),
})
PYRepository: lidge-jun/opencodex Length of output: 13597 Use the documented OpenAI Chat Completions terminology. In Proposed wording-`api: openai-completions` selects omp's OpenAI-compatible adapter, which talks
-to the proxy's `/v1` surface.
+`api: openai-completions` configures omp to target OpenAI Chat Completions
+through the `openai-chat`-compatible wire format at the proxy's `/v1` surface.🤖 Prompt for AI AgentsSource: Path instructions |
||
|
|
||
| Merge the `providers.opencodex` block into `~/.omp/agent/models.yml` (do not | ||
| replace the rest of the file), then start a new omp session. The models appear | ||
| under the `opencodex/` prefix. | ||
|
|
||
| ## Credential | ||
|
|
||
| The config references `$OPENCODEX_OMP_API_KEY` and never holds the real key. | ||
| Export it before launching omp: | ||
|
|
||
| ```bash | ||
| export OPENCODEX_OMP_API_KEY=<your key> | ||
| ``` | ||
|
|
||
| Like Pi, omp's provider block has no place for the `x-opencodex-api-key` header | ||
| a non-loopback bind requires, so this integration works against a loopback | ||
| bind. Reach a remote opencodex through an SSH tunnel or a local forwarder that | ||
| adds the header instead. | ||
|
|
||
| The dashboard's **Integrations → Oh My Pi** tab does the same thing with a | ||
| switch, and takes a backup before every write so the change can be undone. | ||
Uh oh!
There was an error while loading. Please reload this page.