mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 02:11:28 +00:00
feat(novita): add Novita AI provider preset
- Add novita preset with OpenAI-compatible endpoint - Default model: deepseek/deepseek-v3.2 - Endpoint: https://api.novita.ai/openai - API key via NOVITA_API_KEY env var
This commit is contained in:
@@ -21,6 +21,7 @@ export const PROVIDER_PRESET_IDS = [
|
||||
'deepseek',
|
||||
'qwen',
|
||||
'ollama-cloud',
|
||||
'novita',
|
||||
] as const;
|
||||
|
||||
export type ProviderPresetId = (typeof PROVIDER_PRESET_IDS)[number];
|
||||
@@ -254,6 +255,20 @@ const RAW_PROVIDER_PRESET_DEFINITIONS: readonly ProviderPresetDefinition[] = [
|
||||
badge: 'Cloud',
|
||||
icon: '/icons/ollama.svg',
|
||||
},
|
||||
{
|
||||
id: 'novita',
|
||||
name: 'Novita AI',
|
||||
description: 'OpenAI-compatible API (Llama, Mistral, Qwen, and more)',
|
||||
baseUrl: 'https://api.novita.ai/openai',
|
||||
defaultProfileName: 'novita',
|
||||
defaultModel: 'deepseek/deepseek-v3.2',
|
||||
apiKeyPlaceholder: 'YOUR_NOVITA_API_KEY',
|
||||
apiKeyHint: 'Get your API key at novita.ai',
|
||||
category: 'alternative',
|
||||
requiresApiKey: true,
|
||||
badge: 'OpenAI-compatible',
|
||||
icon: '/icons/novita.svg',
|
||||
},
|
||||
];
|
||||
|
||||
function clonePresetDefinition(preset: ProviderPresetDefinition): ProviderPresetDefinition {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import { getPresetById, isValidPresetId } from '../../../src/api/services/provider-presets';
|
||||
|
||||
describe('provider-presets-novita', () => {
|
||||
it('resolves novita preset id', () => {
|
||||
const preset = getPresetById('novita');
|
||||
expect(preset?.id).toBe('novita');
|
||||
expect(preset?.baseUrl).toBe('https://api.novita.ai/openai');
|
||||
expect(preset?.defaultProfileName).toBe('novita');
|
||||
});
|
||||
|
||||
it('resolves novita preset with expected model IDs', () => {
|
||||
const preset = getPresetById('novita');
|
||||
expect(preset?.defaultModel).toBe('deepseek/deepseek-v3.2');
|
||||
});
|
||||
|
||||
it('validates novita preset requires API key', () => {
|
||||
const preset = getPresetById('novita');
|
||||
expect(preset?.requiresApiKey).toBe(true);
|
||||
});
|
||||
|
||||
it('treats novita as a valid preset id', () => {
|
||||
expect(isValidPresetId('novita')).toBe(true);
|
||||
});
|
||||
|
||||
it('handles whitespace in novita preset id', () => {
|
||||
const preset = getPresetById(' novita ');
|
||||
expect(preset?.id).toBe('novita');
|
||||
});
|
||||
|
||||
it('handles uppercase novita preset id', () => {
|
||||
const preset = getPresetById('NOVITA');
|
||||
expect(preset?.id).toBe('novita');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user