Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 2, 2025

Summary

This PR adds support for Poe.com as an LLM provider in Roo-Code. Poe provides an API that is fully compatible with the OpenAI Chat Completions format, allowing users to access a wide variety of models including GPT, Claude, Gemini, Llama, Mistral, and more through a single API.

Changes

  • Added Poe provider type definitions with support for 20+ models
  • Implemented PoeHandler extending BaseOpenAiCompatibleProvider
  • Added Poe to provider settings schema and API handler
  • Included comprehensive tests for Poe provider functionality
  • Added support for custom Poe bots with default model info
  • Updated webview UI to handle Poe provider selection

Benefits

  • Users can access multiple LLM models through a single Poe API key
  • Reduces the need to manage multiple provider accounts
  • Supports both predefined models and custom Poe bots
  • Fully compatible with existing OpenAI-style API infrastructure

Testing

  • All provider tests pass successfully
  • Type checking passes
  • Linting passes

Closes #6594


Important

Adds Poe.com as an LLM provider, integrating it into the existing infrastructure with support for multiple models and custom bots.

  • Behavior:
    • Adds PoeHandler in src/api/providers/poe.ts extending BaseOpenAiCompatibleProvider to handle Poe API interactions.
    • Updates buildApiHandler() in src/api/index.ts to include PoeHandler for "poe" provider.
    • Supports 20+ models and custom bots with default model info.
  • Provider Settings:
    • Adds "poe" to providerNames and providerSettingsSchema in provider-settings.ts.
    • Defines poeSchema for Poe-specific settings.
  • UI:
    • Updates useSelectedModel() in useSelectedModel.ts to handle Poe provider selection.
  • Tests:
    • Adds poe.spec.ts for testing PoeHandler functionality, including model selection and API interactions.

This description was created by Ellipsis for 7d13177. You can customize this summary. It will automatically update as commits are pushed.

roomote added 2 commits August 2, 2025 09:33
- Add Poe provider type definitions with support for multiple models
- Implement PoeHandler extending BaseOpenAiCompatibleProvider
- Add Poe to provider settings schema and API handler
- Include comprehensive tests for Poe provider functionality
- Support custom bots with default model info

Closes #6594
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 2, 2025 09:36
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Aug 2, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed my own code and found it suspiciously adequate.


const poeSchema = apiModelIdProviderModelSchema.extend({
poeApiKey: z.string().optional(),
poeBaseUrl: z.string().optional(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that other recent providers have i18n entries for their API keys (e.g., groqApiKey), but this PR doesn't add translations for poeApiKey and poeBaseUrl. Is this intentional, or should we add i18n entries for consistency?

I see that the English common.json doesn't have a providers section, so perhaps this is following a different pattern?


const poeSchema = apiModelIdProviderModelSchema.extend({
poeApiKey: z.string().optional(),
poeBaseUrl: z.string().optional(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding URL validation for poeBaseUrl similar to other providers. Currently it accepts any string, but validating it as a proper URL could prevent configuration errors:

Suggested change
poeBaseUrl: z.string().optional(),
poeBaseUrl: z.string().url().optional(),

contextWindow: 128000,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 2.5,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pricing information looks comprehensive! Is this pricing data current and accurate? It might be helpful to add a comment indicating the source of this pricing information and when it was last updated, to help with future maintenance.

}),
)
})
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great test coverage! Consider adding a few edge case tests:

  • Invalid API key handling (401/403 responses)
  • Network timeout scenarios
  • Malformed response handling from the Poe API

These would help ensure robust error handling in production.


import { BaseOpenAiCompatibleProvider } from "./base-openai-compatible-provider"

export class PoeHandler extends BaseOpenAiCompatibleProvider<PoeModelId> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making the API documentation link more prominent with a JSDoc comment:

Suggested change
export class PoeHandler extends BaseOpenAiCompatibleProvider<PoeModelId> {
/**
* Poe API Handler - Provides access to multiple LLM models through Poe's OpenAI-compatible API
*
* API Documentation: https://creator.poe.com/docs/external-applications/openai-compatible-api
*
* Supports both predefined models (GPT, Claude, Gemini, etc.) and custom Poe bots.
*/
export class PoeHandler extends BaseOpenAiCompatibleProvider<PoeModelId> {

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 2, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 2, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 2, 2025
@daniel-lxs daniel-lxs closed this Aug 5, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Aug 5, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Needs Preliminary Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Proposal: Support poe.com as an LLM provider

4 participants