Skip to content

OpenAI baseUrl support #216

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

molander
Copy link

@molander molander commented Jun 8, 2025

Hi, awesome project! I had some trouble getting OpenAI API compat endpoints working, so I made some minimal changes to make it easier. This adds basic OpenAI-compatible provider support as a practical stopgap solution while you guys are discussing other methods. LiteLLM is the easy button and a great opensource project, fwiw!

Adds environment variable support for:

  • OPENAI_BASE_URL - override base URL for compatible providers
  • OPENAI_MODEL_OVERRIDE - override model name
  • OPENAI_EXTRA_HEADERS - custom headers (key=value,key=value)
  • OPENAI_REASONING_EFFORT - reasoning effort level

This allows users to immediately use any OpenAI API compatible endpoint like LocalAI.io without code changes.

Sorry if I mangled any Go, first time for everything.

Thanks for your efforts, much appreciated!

monotykamary and others added 16 commits June 5, 2025 22:20
🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
Introduces a new global configuration option `alwaysAllowPermissions`
and a corresponding CLI flag `--always-allow-permissions` (shorthand `-A`).

When this setting is enabled, all permission prompts during a session
are bypassed, and operations are automatically allowed. This provides
a more streamlined experience for users who trust all operations
performed by the tool.

The configuration is persisted across sessions.

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
The --always-allow-permissions flag no longer automatically updates the user's configuration file. This change ensures that the setting is manually configured by the user, and only affects the current session unless explicitly set in the config.
This commit introduces the ability for users to hide and show the sidebar
by pressing `ctrl+b`. This feature provides more screen real estate for
the main chat view, which is especially useful on smaller screens.

The implementation involves:

- Adding a `hidden` state to the `sidebarCmp` component.
- Creating a `ToggleSidebarMsg` to toggle the sidebar's visibility.
- Adding a keybinding (`ctrl+b`) to the chat page to dispatch the message.
- Modifying the `splitPaneLayout` to forward the message to the sidebar.

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
When the sidebar is hidden, the chat view now expands to fill the available space.

This is achieved by updating the layout to recalculate its dimensions when the sidebar's visibility changes.

This also fixes a bug where the status bar would overlap the chat input when the sidebar was hidden.
This commit introduces a confirmation step for canceling an ongoing agent operation. Users must now press the `esc` key twice in quick succession to cancel, preventing accidental cancellations.

The implementation involves:
- Adding a timeout to the `esc` key press in the chat page.
- Passing the `firstEsc` state down to the message list component to update the help message.
- Adding a `Model()` method to the `layout.Container` to allow the chat page to access the message list's model.

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
@sudip358
Copy link

image
can you add similar base url for all models gemini, anthropic like cline/roo code?

@sudip358
Copy link

sudip358 commented Jun 16, 2025

my provider is not openai compatible

@dennypenta
Copy link

dennypenta commented Jun 17, 2025

looking forward to merging this feature, happy to use it.
Im gonna try installing it today from branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants