Skip to content
Merged
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
2 changes: 2 additions & 0 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const QDRANT: string = 'qdrant';
export const THREE_ZERO_TWO_AI: string = '302ai';
export const MESHY: string = 'meshy';
export const TRIPO3D: string = 'tripo3d';
export const NEXTBIT: string = 'nextbit';

export const VALID_PROVIDERS = [
ANTHROPIC,
Expand Down Expand Up @@ -171,6 +172,7 @@ export const VALID_PROVIDERS = [
THREE_ZERO_TWO_AI,
MESHY,
TRIPO3D,
NEXTBIT,
];

export const CONTENT_TYPES = {
Expand Down
2 changes: 2 additions & 0 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import KrutrimConfig from './krutrim';
import AI302Config from './302ai';
import MeshyConfig from './meshy';
import Tripo3DConfig from './tripo3d';
import { NextBitConfig } from './nextbit';

const Providers: { [key: string]: ProviderConfigs } = {
openai: OpenAIConfig,
Expand Down Expand Up @@ -129,6 +130,7 @@ const Providers: { [key: string]: ProviderConfigs } = {
krutrim: KrutrimConfig,
'302ai': AI302Config,
meshy: MeshyConfig,
nextbit: NextBitConfig,
tripo3d: Tripo3DConfig,
};

Expand Down
19 changes: 19 additions & 0 deletions src/providers/nextbit/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ProviderAPIConfig } from '../types';

export const nextBitAPIConfig: ProviderAPIConfig = {
getBaseURL: () => 'https://api.nextbit256.com/v1',
headers({ providerOptions }) {
const { apiKey } = providerOptions;
return { Authorization: `Bearer ${apiKey}` };
},
getEndpoint({ fn }) {
switch (fn) {
case 'chatComplete':
return '/chat/completions';
case 'complete':
return '/completions';
default:
return '';
}
},
};
18 changes: 18 additions & 0 deletions src/providers/nextbit/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NEXTBIT } from '../../globals';
import {
chatCompleteParams,
completeParams,
responseTransformers,
} from '../open-ai-base';
import { ProviderConfigs } from '../types';
import { nextBitAPIConfig } from './api';

export const NextBitConfig: ProviderConfigs = {
chatComplete: chatCompleteParams([], { model: 'microsoft:phi-4' }),
complete: completeParams([], { model: 'microsoft:phi-4' }),
api: nextBitAPIConfig,
responseTransforms: responseTransformers(NEXTBIT, {
chatComplete: true,
complete: true,
}),
};