Skip to content

Commit

Permalink
Merge pull request #885 from narengogi/feat/replicate
Browse files Browse the repository at this point in the history
support replicate as provider (proxy only)
  • Loading branch information
VisargD authored Jan 27, 2025
2 parents 42855ea + 7b7eeda commit 3ba12e8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const SAGEMAKER: string = 'sagemaker';
export const NEBIUS: string = 'nebius';
export const RECRAFTAI: string = 'recraft-ai';
export const MILVUS: string = 'milvus';
export const REPLICATE: string = 'replicate';

export const VALID_PROVIDERS = [
ANTHROPIC,
Expand Down Expand Up @@ -132,6 +133,7 @@ export const VALID_PROVIDERS = [
NEBIUS,
RECRAFTAI,
MILVUS,
REPLICATE,
POWERED_BY,
];

Expand Down
3 changes: 3 additions & 0 deletions src/providers/azure-openai/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export const AzureOpenAIChatCompleteConfig: ProviderConfig = {
prediction: {
param: 'prediction',
},
reasoning_effort: {
param: 'reasoning_effort',
},
};

interface AzureOpenAIChatCompleteResponse extends ChatCompletionResponse {}
Expand Down
2 changes: 2 additions & 0 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import SagemakerConfig from './sagemaker';
import NebiusConfig from './nebius';
import RecraftAIConfig from './recraft-ai';
import MilvusConfig from './milvus';
import ReplicateConfig from './replicate';

const Providers: { [key: string]: ProviderConfigs } = {
openai: OpenAIConfig,
Expand Down Expand Up @@ -106,6 +107,7 @@ const Providers: { [key: string]: ProviderConfigs } = {
nebius: NebiusConfig,
'recraft-ai': RecraftAIConfig,
milvus: MilvusConfig,
replicate: ReplicateConfig,
};

export default Providers;
11 changes: 11 additions & 0 deletions src/providers/replicate/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ProviderAPIConfig } from '../types';

const ReplicateApiConfig: ProviderAPIConfig = {
getBaseURL: () => 'https://api.replicate.com/v1',
headers: ({ providerOptions }) => {
return { Authorization: `Bearer ${providerOptions.apiKey}` };
},
getEndpoint: ({ fn }) => '',
};

export default ReplicateApiConfig;
9 changes: 9 additions & 0 deletions src/providers/replicate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ProviderConfigs } from '../types';
import ReplicateAPIConfig from './api';

const ReplicateConfig: ProviderConfigs = {
api: ReplicateAPIConfig,
responseTransforms: {},
};

export default ReplicateConfig;

0 comments on commit 3ba12e8

Please sign in to comment.