Add Provider
Goal
Generate DeepChat provider integration changes against the current provider architecture. Keep
provider display data in PublicProviderConf, map runtime behavior to known transports, and use a
special provider implementation only when the API behavior requires one.
Required Inputs
Collect or derive these before editing source:
- Provider ID in kebab case.
- Display name.
- API type or known transport family.
- Default base URL.
- Auth type: API key, no auth, OAuth, profile credentials, or provider-specific credential.
- Model metadata source: built-in config, provider-db, config-db, live model fetch, or custom only.
- Test model ID and check strategy.
- Official website, API key URL, docs URL, model list URL.
- Request quirks: headers, endpoint suffixes, route rewrites, streaming shape, tool-call support,
reasoning support, image/audio/embedding endpoints, or proxy requirements.
Supported Paths
OpenAI-Compatible API
Use this when the provider supports OpenAI Chat Completions or Responses-compatible HTTP APIs.
Typical files:
src/main/provider/defaults.ts
src/main/provider/providerId.ts
src/main/provider/providerRegistry.ts
src/shared/providerDbCatalog.ts when models come from the public provider database
test/main/** provider registry or creation tests
Existing Native Transport
Use this when the provider maps to an existing DeepChat transport such as Anthropic, Gemini, Vertex,
Azure, Bedrock, Ollama, or ACP.
Typical files:
src/main/provider/defaults.ts
src/main/provider/providerRegistry.ts
- Settings components only when the existing generic form lacks required fields
- Focused tests for provider creation and connection checks
Special Provider
Use this when auth, request shape, streaming, discovery, or error handling differs from existing
transports.
Typical files:
src/main/provider/providers/<providerName>Provider.ts
src/main/provider/<providerName>Adapter.ts
src/main/provider/managers/providerInstanceManager.ts
src/shared/contracts/routes/* and src/renderer/api/*Client.ts for interactive auth
src/renderer/settings/components/* for provider-specific settings UI
- Main and renderer tests covering the new behavior
Guardrails
- Do not introduce
ProviderRuntimeDefinition, generated runtime manifests, or runtime package-name
inference.
- Do not install provider SDK packages automatically.
- Do not execute provider logic in the renderer.
- Do not store new OAuth credentials in provider API-key fields.
- Do not add a special provider when a known transport and explicit config are sufficient.
- Reject the request when the required inputs cannot identify a safe path.
Workflow
- Read
docs/features/provider-runtime/spec.md when the provider work touches the provider runtime
scope. Also read plan.md if it exists for an active provider-runtime goal. Treat any legacy
tasks.md as migration input rather than another execution tracker.
- Inspect the current provider files before editing:
src/main/provider/defaults.ts
src/main/provider/providerId.ts
src/main/provider/providerRegistry.ts
src/main/provider/aiSdk/providerFactory.ts
src/main/provider/managers/providerInstanceManager.ts
src/renderer/settings/components/ProviderApiConfig.vue
- Classify the request into one supported path.
- Add the smallest explicit source changes for that path.
- After implementation, assess provider creation, auth handling, and model discovery for durable
regression coverage; add only the smallest contract-level tests warranted.
- Update an active SDD
plan.md as coherent implementation slices land, when one exists. For a
legacy tasks.md, merge remaining work into the existing plan; without one, keep a single-slice
complex bug checklist in spec.md and create plan.md for feature, architecture, or multi-slice
bug work. Do not update or recreate the task file.
- Run:
pnpm run format
pnpm run i18n
pnpm run lint
pnpm run typecheck
Run focused main/renderer tests for any touched provider code.
Output Checklist
Report:
- Provider ID and API type.
- Selected path.
- Files changed.
- Runtime transport or special provider class.
- Credential storage location.
- Model metadata source.
- Check strategy and test model.
- Validation commands run.
1---
2name: add-provider
3description: Add a DeepChat LLM provider through explicit reviewed source changes. Use when a developer asks Codex to add a provider, provider profile, upstream provider config, model catalog mapping, provider auth behavior, or a special provider adapter in this repository.
4metadata:
5 source: https://skillmd.com/skills/thinkinaixyz/add-provider
6---
7
8# Add Provider
9
10## Goal
11
12Generate DeepChat provider integration changes against the current provider architecture. Keep
13provider display data in `PublicProviderConf`, map runtime behavior to known transports, and use a
14special provider implementation only when the API behavior requires one.
15
16## Required Inputs
17
18Collect or derive these before editing source:
19
20- Provider ID in kebab case.
21- Display name.
22- API type or known transport family.
23- Default base URL.
24- Auth type: API key, no auth, OAuth, profile credentials, or provider-specific credential.
25- Model metadata source: built-in config, provider-db, config-db, live model fetch, or custom only.
26- Test model ID and check strategy.
27- Official website, API key URL, docs URL, model list URL.
28- Request quirks: headers, endpoint suffixes, route rewrites, streaming shape, tool-call support,
29 reasoning support, image/audio/embedding endpoints, or proxy requirements.
30
31## Supported Paths
32
33### OpenAI-Compatible API
34
35Use this when the provider supports OpenAI Chat Completions or Responses-compatible HTTP APIs.
36
37Typical files:
38
39- `src/main/provider/defaults.ts`
40- `src/main/provider/providerId.ts`
41- `src/main/provider/providerRegistry.ts`
42- `src/shared/providerDbCatalog.ts` when models come from the public provider database
43- `test/main/**` provider registry or creation tests
44
45### Existing Native Transport
46
47Use this when the provider maps to an existing DeepChat transport such as Anthropic, Gemini, Vertex,
48Azure, Bedrock, Ollama, or ACP.
49
50Typical files:
51
52- `src/main/provider/defaults.ts`
53- `src/main/provider/providerRegistry.ts`
54- Settings components only when the existing generic form lacks required fields
55- Focused tests for provider creation and connection checks
56
57### Special Provider
58
59Use this when auth, request shape, streaming, discovery, or error handling differs from existing
60transports.
61
62Typical files:
63
64- `src/main/provider/providers/<providerName>Provider.ts`
65- `src/main/provider/<providerName>Adapter.ts`
66- `src/main/provider/managers/providerInstanceManager.ts`
67- `src/shared/contracts/routes/*` and `src/renderer/api/*Client.ts` for interactive auth
68- `src/renderer/settings/components/*` for provider-specific settings UI
69- Main and renderer tests covering the new behavior
70
71## Guardrails
72
73- Do not introduce `ProviderRuntimeDefinition`, generated runtime manifests, or runtime package-name
74 inference.
75- Do not install provider SDK packages automatically.
76- Do not execute provider logic in the renderer.
77- Do not store new OAuth credentials in provider API-key fields.
78- Do not add a special provider when a known transport and explicit config are sufficient.
79- Reject the request when the required inputs cannot identify a safe path.
80
81## Workflow
82
831. Read `docs/features/provider-runtime/spec.md` when the provider work touches the provider runtime
84 scope. Also read `plan.md` if it exists for an active provider-runtime goal. Treat any legacy
85 `tasks.md` as migration input rather than another execution tracker.
862. Inspect the current provider files before editing:
87 - `src/main/provider/defaults.ts`
88 - `src/main/provider/providerId.ts`
89 - `src/main/provider/providerRegistry.ts`
90 - `src/main/provider/aiSdk/providerFactory.ts`
91 - `src/main/provider/managers/providerInstanceManager.ts`
92 - `src/renderer/settings/components/ProviderApiConfig.vue`
933. Classify the request into one supported path.
944. Add the smallest explicit source changes for that path.
955. After implementation, assess provider creation, auth handling, and model discovery for durable
96 regression coverage; add only the smallest contract-level tests warranted.
976. Update an active SDD `plan.md` as coherent implementation slices land, when one exists. For a
98 legacy `tasks.md`, merge remaining work into the existing plan; without one, keep a single-slice
99 complex bug checklist in `spec.md` and create `plan.md` for feature, architecture, or multi-slice
100 bug work. Do not update or recreate the task file.
1017. Run:
102
103```bash
104pnpm run format
105pnpm run i18n
106pnpm run lint
107pnpm run typecheck
108```
109
110Run focused main/renderer tests for any touched provider code.
111
112## Output Checklist
113
114Report:
115
116- Provider ID and API type.
117- Selected path.
118- Files changed.
119- Runtime transport or special provider class.
120- Credential storage location.
121- Model metadata source.
122- Check strategy and test model.
123- Validation commands run.