mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-19 10:14:56 +00:00
Merge pull request #1573 from tiennm99/fix/update-provider-model-templates
fix(config): update provider default models
This commit is contained in:
8 files changed
+82
-26
No files matched your search
@@ -29,6 +29,14 @@ describe('provider-presets', () => {
|
||||
expect(preset?.id).toBe('km');
|
||||
});
|
||||
|
||||
it('tracks current provider default model updates', () => {
|
||||
expect(getPresetById('glm')?.defaultModel).toBe('glm-5.2');
|
||||
expect(getPresetById('glmt')?.defaultModel).toBe('glm-5.2');
|
||||
expect(getPresetById('km')?.defaultModel).toBe('kimi-for-coding');
|
||||
expect(getPresetById('kimi')?.defaultModel).toBe('kimi-for-coding');
|
||||
expect(getPresetById('mm')?.defaultModel).toBe('MiniMax-M3');
|
||||
});
|
||||
|
||||
it('resolves llama.cpp preset with local-provider sentinel token', () => {
|
||||
const preset = getPresetById('llamacpp');
|
||||
expect(preset?.id).toBe('llamacpp');
|
||||
@@ -110,7 +118,11 @@ describe('provider-presets', () => {
|
||||
for (const preset of PROVIDER_PRESETS) {
|
||||
if (!preset.icon) continue;
|
||||
|
||||
const iconPath = resolve(import.meta.dir, '../../../ui/public', preset.icon.replace(/^\/+/, ''));
|
||||
const iconPath = resolve(
|
||||
import.meta.dir,
|
||||
'../../../ui/public',
|
||||
preset.icon.replace(/^\/+/, '')
|
||||
);
|
||||
expect(existsSync(iconPath)).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -65,6 +65,30 @@ describe('model-pricing', () => {
|
||||
expect(pricing.inputPerMillion).toBe(0.6);
|
||||
});
|
||||
|
||||
it('should price current provider preset defaults without fallback rates', () => {
|
||||
const fallback = getModelPricing('unknown-model-xyz');
|
||||
|
||||
expect(getModelPricing('glm-5.2')).toMatchObject({
|
||||
inputPerMillion: 1.4,
|
||||
outputPerMillion: 4.4,
|
||||
cacheReadPerMillion: 0.26,
|
||||
});
|
||||
expect(getModelPricing('MiniMax-M3')).toMatchObject({
|
||||
inputPerMillion: 0.3,
|
||||
outputPerMillion: 1.2,
|
||||
cacheReadPerMillion: 0.06,
|
||||
});
|
||||
expect(getModelPricing('MiniMax-M3', { serviceTier: 'priority' })).toMatchObject({
|
||||
inputPerMillion: 0.45,
|
||||
outputPerMillion: 1.8,
|
||||
cacheReadPerMillion: 0.09,
|
||||
});
|
||||
|
||||
expect(getModelPricing('glm-5.2')).not.toEqual(fallback);
|
||||
expect(getModelPricing('MiniMax-M3')).not.toEqual(fallback);
|
||||
expect(getModelPricing('kimi-for-coding')).not.toEqual(fallback);
|
||||
});
|
||||
|
||||
it('should not use fallback pricing for known Qwen catalog IDs', () => {
|
||||
const fallback = getModelPricing('unknown-model-xyz');
|
||||
const catalogIds = ['qwen3-235b', 'qwen3-vl-plus', 'qwen3-32b'];
|
||||
|
||||
Reference in new issue
Block a user