Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/renderer/static/icons/providers/openpaths.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/shared/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const aiProviderNameHash: Record<ModelProviderEnum, string> = {
[ModelProviderEnum.Perplexity]: 'Perplexity API',
[ModelProviderEnum.XAI]: 'xAI API',
[ModelProviderEnum.OpenRouter]: 'OpenRouter API',
[ModelProviderEnum.OpenPaths]: 'OpenPaths API',
[ModelProviderEnum.Bedrock]: 'AWS Bedrock',
[ModelProviderEnum.VercelAIGateway]: 'Vercel AI Gateway',
[ModelProviderEnum.Custom]: 'Custom Provider',
Expand Down Expand Up @@ -115,6 +116,11 @@ export const AIModelProviderMenuOptionList = [
label: aiProviderNameHash[ModelProviderEnum.OpenRouter],
disabled: false,
},
{
value: ModelProviderEnum.OpenPaths,
label: aiProviderNameHash[ModelProviderEnum.OpenPaths],
disabled: false,
},
{
value: ModelProviderEnum.MistralAI,
label: aiProviderNameHash[ModelProviderEnum.MistralAI],
Expand Down
28 changes: 28 additions & 0 deletions src/shared/providers/definitions/models/openpaths.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import OpenAICompatible, { type OpenAICompatibleSettings } from '../../../models/openai-compatible'
import type { ModelDependencies } from '../../../types/adapters'

interface Options extends OpenAICompatibleSettings {}

export default class OpenPaths extends OpenAICompatible {
public name = 'OpenPaths'
public options: Options
constructor(options: Omit<Options, 'apiHost'>, dependencies: ModelDependencies) {
const apiHost = 'https://openpaths.io/v1'
super(
{
apiKey: options.apiKey,
apiHost,
model: options.model,
temperature: options.temperature,
topP: options.topP,
maxOutputTokens: options.maxOutputTokens,
stream: options.stream,
},
dependencies
)
this.options = {
...options,
apiHost,
}
}
}
79 changes: 79 additions & 0 deletions src/shared/providers/definitions/openpaths.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { ModelProviderEnum, ModelProviderType } from '../../types'
import { defineProvider } from '../registry'
import OpenPaths from './models/openpaths'

export const openPathsProvider = defineProvider({
id: ModelProviderEnum.OpenPaths,
name: 'OpenPaths',
type: ModelProviderType.OpenAI,
curatedModelIds: [
'openpaths/auto',
'openpaths/auto-code',
'openpaths/auto-fast',
'openpaths/auto-cheap',
'openpaths/auto-reasoning',
'openpaths/auto-vision',
'openpaths/auto-image',
],
urls: {
website: 'https://openpaths.io',
apiKey: 'https://openpaths.io/account',
models: 'https://openpaths.io/v1/models',
},
defaultSettings: {
apiHost: 'https://openpaths.io/v1',
models: [
{
modelId: 'openpaths/auto',
nickname: 'Auto',
capabilities: ['tool_use', 'reasoning', 'vision'],
},
{
modelId: 'openpaths/auto-code',
nickname: 'Auto Code',
capabilities: ['tool_use', 'reasoning'],
},
{
modelId: 'openpaths/auto-fast',
nickname: 'Auto Fast',
capabilities: ['tool_use'],
},
{
modelId: 'openpaths/auto-cheap',
nickname: 'Auto Cheap',
capabilities: ['tool_use'],
},
{
modelId: 'openpaths/auto-reasoning',
nickname: 'Auto Reasoning',
capabilities: ['tool_use', 'reasoning'],
},
{
modelId: 'openpaths/auto-vision',
nickname: 'Auto Vision',
capabilities: ['tool_use', 'vision'],
},
{
modelId: 'openpaths/auto-image',
nickname: 'Auto Image',
capabilities: ['vision'],
Comment on lines +57 to +59

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove image-generation router from chat defaults

When OpenPaths is configured, this entry is treated as a chat model because ModelSelector includes models with no type or type === 'chat', but OpenPaths documents openpaths/auto-image as an image-generation model served via the image endpoint. Since the new OpenPaths class extends OpenAICompatible without image-generation support, selecting “Auto Image” in a chat session sends it through chat completions with vision capabilities and will fail for users who pick that default model; either mark/remove it from the chat defaults or add the provider to the image-generation path.

Useful? React with 👍 / 👎.

},
],
},
createModel: (config) => {
return new OpenPaths(
{
apiKey: config.effectiveApiKey,
model: config.model,
temperature: config.settings.temperature,
topP: config.settings.topP,
maxOutputTokens: config.settings.maxTokens,
stream: config.settings.stream,
},
config.dependencies
)
},
getDisplayName: (modelId, providerSettings) => {
return `OpenPaths API (${providerSettings?.models?.find((m) => m.modelId === modelId)?.nickname || modelId})`
},
})
1 change: 1 addition & 0 deletions src/shared/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import './definitions/minimax'
import './definitions/moonshot'
import './definitions/siliconflow'
import './definitions/openrouter'
import './definitions/openpaths'
import './definitions/ollama'
import './definitions/lmstudio'
import './definitions/azure'
Expand Down
1 change: 1 addition & 0 deletions src/shared/types/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export enum ModelProviderEnum {
Perplexity = 'perplexity',
XAI = 'xAI',
OpenRouter = 'openrouter',
OpenPaths = 'openpaths',
Bedrock = 'bedrock',
VercelAIGateway = 'vercel-ai-gateway',
Custom = 'custom',
Expand Down
1 change: 1 addition & 0 deletions src/shared/utils/llm_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export function isOpenAICompatible(providerId: string, _modelId: string) {
ModelProviderEnum.OpenAI,
ModelProviderEnum.SiliconFlow,
ModelProviderEnum.OpenRouter,
ModelProviderEnum.OpenPaths,
ModelProviderEnum.Ollama,
ModelProviderEnum.ChatGLM6B,
ModelProviderEnum.XAI,
Expand Down