-
Notifications
You must be signed in to change notification settings - Fork 771
feat: Add Snowflake Cortex LLM API #988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
53122cf
25f4c11
e86bc29
f034fb9
fa23861
9a8525a
33656c8
45f12c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { ProviderAPIConfig } from '../types'; | ||
|
|
||
| const CortexAPIConfig: ProviderAPIConfig = { | ||
| getBaseURL: ({ providerOptions }) => | ||
| `https://${(providerOptions as any).snowflakeAccount}.snowflakecomputing.com/api/v2`, | ||
| headers: ({ providerOptions }) => ({ | ||
| 'X-Snowflake-Authorization-Token-Type': 'KEYPAIR_JWT', | ||
| Authorization: `Bearer ${(providerOptions as any).snowflakeApiKey || providerOptions.apiKey}`, | ||
| 'Content-Type': 'application/json', | ||
| Accept: 'application/json, text/event-stream', | ||
| }), | ||
| getEndpoint: ({ fn }) => { | ||
| switch (fn) { | ||
| case 'chatComplete': | ||
| return '/cortex/inference:complete'; | ||
| default: | ||
| return ''; | ||
| } | ||
| }, | ||
| }; | ||
|
|
||
| export default CortexAPIConfig; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { ProviderConfigs } from '../types'; | ||
| import CortexAPIConfig from './api'; | ||
| import { CORTEX } from '../../globals'; | ||
| import { | ||
| chatCompleteParams, | ||
| completeParams, | ||
| embedParams, | ||
| responseTransformers, | ||
| } from '../open-ai-base'; | ||
|
|
||
| const CortexConfig: ProviderConfigs = { | ||
| chatComplete: chatCompleteParams([], { model: 'mistral-large' }), | ||
| complete: completeParams([], { model: 'mistral-large' }), | ||
| embed: embedParams([], { model: 'mistral-large' }), | ||
| api: CortexAPIConfig, | ||
| responseTransforms: responseTransformers(CORTEX, { | ||
| chatComplete: true, | ||
| complete: true, | ||
| embed: true, | ||
| }), | ||
VisargD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| export default CortexConfig; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,6 +145,10 @@ export interface Options { | |
|
|
||
| /** Fireworks finetune required fields */ | ||
| fireworksAccountId?: string; | ||
|
|
||
| /** Cortex specific fields */ | ||
| snowflakeAccount?: string; | ||
| snowflakeApiKey?: string; | ||
|
||
| } | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.