mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-11 03:13:12 +00:00
Merge pull request #1414 from cerebrixos/tuning-engines-provider
Add Tuning Engines provider
This commit is contained in:
3 files changed
+39
No files matched your search
@@ -6,6 +6,7 @@ your API profile points at an OpenAI-compatible chat completions endpoint.
|
||||
This is useful for providers such as:
|
||||
|
||||
- Hugging Face Inference Providers
|
||||
- Tuning Engines
|
||||
- OpenRouter
|
||||
- Ollama
|
||||
- llama.cpp servers
|
||||
@@ -48,10 +49,18 @@ Create or reuse an API profile that points at an OpenAI-compatible endpoint:
|
||||
ccs api create --preset hf
|
||||
```
|
||||
|
||||
For Tuning Engines:
|
||||
|
||||
```bash
|
||||
ccs api create --preset te
|
||||
```
|
||||
|
||||
Then you can use the profile directly:
|
||||
|
||||
```bash
|
||||
ccs hf
|
||||
# or
|
||||
ccs te
|
||||
```
|
||||
|
||||
CCS detects that the profile is OpenAI-compatible and auto-routes Claude Code
|
||||
|
||||
@@ -12,6 +12,7 @@ export const PROVIDER_PRESET_IDS = [
|
||||
'openrouter',
|
||||
'alibaba-coding-plan',
|
||||
'huggingface',
|
||||
'tuningengines',
|
||||
'ollama',
|
||||
'llamacpp',
|
||||
'anthropic',
|
||||
@@ -62,6 +63,8 @@ export const PROVIDER_PRESET_ALIASES: Readonly<Record<string, ProviderPresetId>>
|
||||
alibaba: 'alibaba-coding-plan',
|
||||
acp: 'alibaba-coding-plan',
|
||||
hf: 'huggingface',
|
||||
te: 'tuningengines',
|
||||
tuning: 'tuningengines',
|
||||
});
|
||||
|
||||
const RAW_PROVIDER_PRESET_DEFINITIONS: readonly ProviderPresetDefinition[] = [
|
||||
@@ -154,6 +157,20 @@ const RAW_PROVIDER_PRESET_DEFINITIONS: readonly ProviderPresetDefinition[] = [
|
||||
defaultTarget: 'droid',
|
||||
badge: 'Router',
|
||||
},
|
||||
{
|
||||
id: 'tuningengines',
|
||||
name: 'Tuning Engines',
|
||||
description: 'OpenAI-compatible chat completions gateway',
|
||||
baseUrl: 'https://api.tuningengines.com/v1',
|
||||
defaultProfileName: 'te',
|
||||
defaultModel: 'gpt-4o',
|
||||
apiKeyPlaceholder: 'sk-te-...',
|
||||
apiKeyHint: 'Create an inference key at app.tuningengines.com/inference/keys',
|
||||
category: 'alternative',
|
||||
requiresApiKey: true,
|
||||
defaultTarget: 'droid',
|
||||
badge: 'Gateway',
|
||||
},
|
||||
{
|
||||
id: 'glm',
|
||||
name: 'GLM',
|
||||
|
||||
@@ -100,6 +100,19 @@ describe('provider-presets', () => {
|
||||
expect(isValidPresetId('hf')).toBe(true);
|
||||
});
|
||||
|
||||
it('resolves Tuning Engines preset metadata and aliases', () => {
|
||||
const preset = getPresetById('tuningengines');
|
||||
expect(preset?.id).toBe('tuningengines');
|
||||
expect(preset?.baseUrl).toBe('https://api.tuningengines.com/v1');
|
||||
expect(preset?.defaultProfileName).toBe('te');
|
||||
expect(preset?.defaultModel).toBe('gpt-4o');
|
||||
expect(preset?.defaultTarget).toBe('droid');
|
||||
expect(preset?.apiKeyPlaceholder).toBe('sk-te-...');
|
||||
expect(getPresetById('te')?.id).toBe('tuningengines');
|
||||
expect(getPresetById('tuning')?.id).toBe('tuningengines');
|
||||
expect(isValidPresetId('te')).toBe(true);
|
||||
});
|
||||
|
||||
it('uses OpenRouter v1 as the OpenAI-compatible API root', () => {
|
||||
const preset = getPresetById('openrouter');
|
||||
expect(preset?.baseUrl).toBe('https://openrouter.ai/api/v1');
|
||||
|
||||
Reference in new issue
Block a user