File tree Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ export const LEPTON: string = 'lepton';
9595export const KLUSTER_AI : string = 'kluster-ai' ;
9696export const NSCALE : string = 'nscale' ;
9797export const HYPERBOLIC : string = 'hyperbolic' ;
98+ export const FEATHERLESS_AI : string = 'featherless-ai' ;
9899
99100export const VALID_PROVIDERS = [
100101 ANTHROPIC ,
@@ -155,6 +156,7 @@ export const VALID_PROVIDERS = [
155156 KLUSTER_AI ,
156157 NSCALE ,
157158 HYPERBOLIC ,
159+ FEATHERLESS_AI ,
158160] ;
159161
160162export const CONTENT_TYPES = {
Original file line number Diff line number Diff line change 1+ import { ProviderAPIConfig } from '../types' ;
2+
3+ export const featherlessAIAPIConfig : ProviderAPIConfig = {
4+ getBaseURL : ( ) => 'https://api.featherless.ai/v1' ,
5+ headers ( { providerOptions } ) {
6+ const { apiKey } = providerOptions ;
7+ return { Authorization : `Bearer ${ apiKey } ` } ;
8+ } ,
9+ getEndpoint ( { fn } ) {
10+ switch ( fn ) {
11+ case 'chatComplete' :
12+ return `/chat/completions` ;
13+ case 'complete' :
14+ return '/completions' ;
15+ default :
16+ return '' ;
17+ }
18+ } ,
19+ } ;
Original file line number Diff line number Diff line change 1+ import { FEATHERLESS_AI } from '../../globals' ;
2+ import {
3+ chatCompleteParams ,
4+ completeParams ,
5+ responseTransformers ,
6+ } from '../open-ai-base' ;
7+ import { ProviderConfigs } from '../types' ;
8+ import { featherlessAIAPIConfig } from './api' ;
9+
10+ export const FeatherlessAIConfig : ProviderConfigs = {
11+ chatComplete : chatCompleteParams ( [ ] , {
12+ model : 'mistralai/Magistral-Small-2506' ,
13+ } ) ,
14+ complete : completeParams ( [ ] , { model : 'mistralai/Magistral-Small-2506' } ) ,
15+ api : featherlessAIAPIConfig ,
16+ responseTransforms : responseTransformers ( FEATHERLESS_AI , {
17+ chatComplete : true ,
18+ complete : true ,
19+ } ) ,
20+ } ;
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ import LeptonConfig from './lepton';
5959import KlusterAIConfig from './kluster-ai' ;
6060import NscaleConfig from './nscale' ;
6161import HyperbolicConfig from './hyperbolic' ;
62+ import { FeatherlessAIConfig } from './featherless-ai' ;
6263
6364const Providers : { [ key : string ] : ProviderConfigs } = {
6465 openai : OpenAIConfig ,
@@ -118,6 +119,7 @@ const Providers: { [key: string]: ProviderConfigs } = {
118119 'kluster-ai' : KlusterAIConfig ,
119120 nscale : NscaleConfig ,
120121 hyperbolic : HyperbolicConfig ,
122+ 'featherless-ai' : FeatherlessAIConfig ,
121123} ;
122124
123125export default Providers ;
You can’t perform that action at this time.
0 commit comments