feat(cli): add openai provider support for OpenAI-compatible endpoints#11941
Open
Thump604 wants to merge 1 commit intoRooCodeInc:mainfrom
Open
feat(cli): add openai provider support for OpenAI-compatible endpoints#11941Thump604 wants to merge 1 commit intoRooCodeInc:mainfrom
Thump604 wants to merge 1 commit intoRooCodeInc:mainfrom
Conversation
Add the `openai` provider to the CLI's supported providers list, enabling use of OpenAI-compatible API endpoints (e.g., locally deployed LLMs via vLLM, llama.cpp, Ollama, LM Studio, etc.). Changes: - Add "openai" to supportedProviders in types.ts - Add "openai" env var mapping (OPENAI_API_KEY) in provider.ts - Add "openai" case in getProviderSettings() with support for OPENAI_BASE_URL environment variable for custom endpoints - Update README environment variable table The openai provider uses the existing @roo-code/types openAi schema (openAiBaseUrl, openAiApiKey, openAiModelId) which is already fully supported in the core extension via OpenAiHandler. Usage: export OPENAI_API_KEY=sk-local export OPENAI_BASE_URL=http://localhost:8080/v1 roo --provider openai --model my-model "Hello" Closes RooCodeInc#11917
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.
Summary
Adds the
openaiprovider to the CLI's supported providers list, enabling use of OpenAI-compatible API endpoints. This allows the CLI to connect to locally deployed LLMs (vLLM, llama.cpp, Ollama, LM Studio, etc.) and any OpenAI-compatible inference server."openai"tosupportedProvidersintypes.tsopenai: "OPENAI_API_KEY"toenvVarMapinprovider.ts"openai"case ingetProviderSettings()withOPENAI_BASE_URLenv var supportThe
openaiprovider already exists in@roo-code/typesas acustomProviderwith full schema support (openAiBaseUrl,openAiApiKey,openAiModelId), and the core extension already handles it viaOpenAiHandler. The CLI simply needed to expose it in its provider whitelist.Usage
Or via settings file (
~/.roo/cli-settings.json):{ "provider": "openai", "model": "my-model" }Difference from
openai-nativeopenaiopenai-native/v1/chat/completions)OPENAI_BASE_URLopenAiBaseUrl,openAiApiKey,openAiModelIdopenAiNativeApiKeyTest plan
http://127.0.0.1:8080/v1--provider openai --model <model> -k <key>resolves correctlyOPENAI_API_KEYandOPENAI_BASE_URLenv vars are read"openai"satisfiesProviderName(already incustomProviders)Closes #11917
Interactively review PR in Roo Code Cloud