-
Notifications
You must be signed in to change notification settings - Fork 174
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Statement
I would like to be able to go through a proxy instead of direct providers APIs
Proposed Solution
export interface ModelConfig {
id: string
name: string
provider: ProviderId
model: string
description?: string
available: boolean
base_url?: string // Add this
custom?: boolean // Add this to identify custom models
}
function getModelInstance(
modelId?: string,
customConfig?: { base_url?: string }
): ChatAnthropic | ChatOpenAI | ChatGoogleGenerativeAI | string {
const model = modelId || getDefaultModel()
if (model.startsWith("claude")) {
const apiKey = getApiKey("anthropic") || "dummy-not-used"
const config: any = {
model,
anthropicApiKey: apiKey
}
// Add base URL if provided
if (customConfig?.base_url) {
config.clientOptions = {
baseURL: customConfig.base_url
}
}
return new ChatAnthropic(config)
}
// ... rest of the function
}Use Case
I have proxies already setup for internal gateways
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request