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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ All notable changes to DreamCoder will be documented in this file.

### Added

- **Per-model settings for third-party models.** Each model in the provider form shows its context window, output limit, thinking levels and image and PDF support, and you can change any of them for that model. Known models (DeepSeek, Qwen, Kimi, GLM, MiniMax, GPT up to the GPT-6 family, Gemini, and Claude through a relay or OpenRouter) get their published values, and saving a provider also reads what the provider reports about its models, including which OpenRouter models can think and at which effort levels. A model nobody knows gets a 128K window, does not think and shows no effort menu, and is marked as using generic defaults. Context windows you typed in yourself are kept (#264).
- **Per-model settings for third-party models.** Each model in the provider form shows its context window, output limit, thinking levels and image and PDF support, and you can change any of them for that model. Known models (DeepSeek, Qwen, Kimi, GLM, MiniMax, GPT up to the GPT-6 family, Gemini, and Claude through a relay or OpenRouter) get their published values, and saving a provider also reads what the provider reports about its models. A model nobody knows gets a 128K window, does not think and shows no effort menu, and is marked as using generic defaults. Context windows you typed in yourself are kept (#264).
- **Model data from models.dev.** Context windows, output limits, thinking modes and effort levels, and image and PDF support for known models now come from [models.dev](https://models.dev) instead of a hand-maintained list, so far more models have published values. The app ships a snapshot of it, refreshes it once an hour and keeps working from the last copy offline; the model settings show "models.dev" next to these values (#291).
- **Provider preset contributor guide.** Adds English and Chinese instructions for adding a built-in provider preset, updating its API tests, and checking connectivity from the settings form (#260). Thanks @harshit3355.

### Changed
Expand Down
6 changes: 5 additions & 1 deletion PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 隐私政策 / Privacy Policy

最后更新 / Last Updated: 2026-09-27
最后更新 / Last Updated: 2026-11-20

---

Expand All @@ -22,6 +22,8 @@ DreamCoder 的桌面应用和会话服务在本机运行,项目不提供托管

DreamCoder 支持连接用户自行选择的 AI 服务提供商,包括预设和自定义端点。发送给服务商的数据受其隐私政策约束,请在配置前阅读相应条款。

DreamCoder 在启动时(本地目录已超过一小时时)和之后每小时从 [models.dev](https://models.dev) 获取公开的模型能力目录(`https://models.dev/api.json`),用来确定模型的上下文窗口、输出上限、思考方式等。请求不包含提示词、代码、API 密钥或其他用户数据;如果在网络设置中配置了手动代理,请求经由该代理发出。获取的目录缓存在配置目录下的 `dreamcoder/cache/models-dev.json`。

Computer Use 使用第三方开源组件 [cua-driver](https://github.com/trycua/cua)(MIT)。开启时,DreamCoder 从 GitHub 下载固定版本的 cua 官方安装器并校验哈希。cua-driver 默认会发送不含内容的产品遥测;DreamCoder 自己安装时会持久关闭它,每次启动也会带上关闭遥测和更新检查的环境变量。如果你本机已有 cua-driver 并开启了遥测,设置页会提示并提供关闭按钮,但不会替你修改;在 macOS 上,环境变量传不到共用的后台进程,只有持久化设置才对它生效。截图和窗口内容会作为工具结果发送给你选择的 AI 服务商。

启用 H5 接入后,桌面会话可从同一局域网内的浏览器访问;请妥善保管访问 Token。若自行配置反向代理,访问范围和传输安全还取决于你的代理设置。
Expand Down Expand Up @@ -55,6 +57,8 @@ DreamCoder runs its desktop app and session service locally; the project does no

DreamCoder can connect to providers you choose through presets or custom endpoints. Data sent to a provider is governed by that provider's privacy policy; review it before configuring the service.

DreamCoder fetches the public model catalog from [models.dev](https://models.dev) (`https://models.dev/api.json`) at startup (when the local copy is more than an hour old) and hourly after that, to determine model context windows, output limits, thinking modes and similar capabilities. The request carries no prompts, code, API keys or other user data; if a manual proxy is set in the network settings, the request goes through it. The fetched catalog is cached at `dreamcoder/cache/models-dev.json` under the config directory.

Computer Use uses the third-party open-source component [cua-driver](https://github.com/trycua/cua) (MIT). When you turn it on, DreamCoder downloads cua's official installer for a pinned version from GitHub and checks its hash. cua-driver sends content-free product telemetry by default; when DreamCoder installs it, DreamCoder turns that off persistently, and every session passes variables that turn telemetry and the update check off. If you already have cua-driver installed with telemetry on, the settings page tells you and offers to turn it off, but does not change it for you; on macOS the variables do not reach the shared background process, so only the persisted setting applies to it. Screenshots and window contents are sent as tool results to the AI provider you chose.

When H5 Access is enabled, desktop sessions can be reached from a browser on the same LAN. Protect the access token. If you set up a reverse proxy, its configuration also determines the access scope and transport security.
Expand Down
31 changes: 31 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,34 @@ The scripts are unchanged except `scripts/lib/system-browser.mjs` and
`scripts/lib/playwright-loader.mjs`, which now reach a browser only through the browser session
that the DreamCoder desktop app provides; the code that started a system browser or looked for one
was removed.

## models.dev catalog snapshot

DreamCoder bundles a snapshot of the model catalog from https://models.dev
(https://github.com/anomalyco/models.dev, `https://models.dev/api.json`) as
`src/server/config/modelsDev.json`, and refreshes it at runtime from the same URL. The snapshot
keeps only the fields DreamCoder reads (context and output limits, reasoning and its options,
input modalities, and each provider's and model's API URL) and drops each model's `id`, which
repeats its key. The data is MIT licensed:

MIT License

Copyright (c) 2025 models.dev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions desktop/sidecars/dreamcoder-sidecar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ if (mode === 'server') {
Object.assign(process.env, await desktopSidecarEnvironment(process.env, LAUNCHER_ENV_KEYS))
const { startServer } = await import('../../src/server/index.ts')
startServer()
const { startModelsDevRefresh } = await import('../../src/server/services/modelsDev/modelsDevRefresh.ts')
void startModelsDevRefresh()
} else {
await import('../../src/entrypoints/cli.tsx')
}
1 change: 1 addition & 0 deletions desktop/src/components/settings/ModelRulesEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const EMPTY_DRAFT: ModelOverrideDraft = { contextWindow: '', maxOutputTokens: ''
const SOURCE_LABEL_KEYS: Record<InheritedSource, TranslationKey> = {
fallback: 'settings.providers.sourceFallback',
model: 'settings.providers.sourceBuiltIn',
modelsDev: 'settings.providers.sourceModelsDev',
site: 'settings.providers.sourceBuiltIn',
discovered: 'settings.providers.sourceDiscovered',
}
Expand Down
15 changes: 15 additions & 0 deletions desktop/src/components/settings/ProviderFormModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,21 @@ describe('ProviderFormModal edit mode', () => {
expect(screen.getByRole('toolbar', { name: 'Thinking for model-1' })).toBeInTheDocument()
})

it('labels values that come from models.dev', () => {
const fromModelsDev: SavedProvider = {
...resolvedProvider,
resolvedModels: {
'model-1': resolvedView({
sources: { contextWindow: 'modelsDev', maxOutputTokens: 'modelsDev', reasoning: 'modelsDev', image: 'fallback', pdf: 'modelsDev', structuredOutput: 'modelsDev' },
}),
},
}
render(<ProviderFormModal open={true} onClose={vi.fn()} mode="edit" provider={fromModelsDev} presets={[deepseekPreset]} />)
fireEvent.click(screen.getByRole('button', { name: 'Model settings for model-1' }))
expect(screen.getByLabelText('Context window for model-1')).toHaveAttribute('placeholder', '1,048,576 · models.dev')
expect(screen.getByTestId('model-rules-editor-model-1')).toHaveTextContent('Default: Low, High, Max (models.dev)')
})

it('saves edited overrides and keeps the fields the form does not edit', async () => {
const withHandWritten: SavedProvider = {
...resolvedProvider,
Expand Down
3 changes: 2 additions & 1 deletion desktop/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ export const en = {
'settings.providers.sourceBuiltIn': 'built-in',
'settings.providers.sourceDiscovered': 'provider API',
'settings.providers.sourceFallback': 'generic default',
'settings.providers.sourceModelsDev': 'models.dev',
'settings.providers.restoreDefault': 'Restore default',
'settings.providers.restoreDefaultFor': 'Restore default: {field}',
'settings.providers.positiveIntegerError': 'Enter a positive integer.',
Expand All @@ -556,7 +557,7 @@ export const en = {
'settings.providers.modelDiscoveryFailed': 'Could not read model information from the provider: {error}',
'settings.providers.savedModelDiscoveryFailed': 'Saved. Open sessions use the new model settings after their next model switch or restart. Could not read model information from the provider: {error}',
'settings.providers.modelRulesApplyLater': 'Saved. Open sessions use the new model settings after their next model switch or restart.',
'settings.providers.modelRulesDesc': "Each model uses built-in rules, values read from the provider, or generic defaults. Open a model's settings to override them.",
'settings.providers.modelRulesDesc': "Each model uses data from models.dev, built-in rules, values read from the provider, or generic defaults. Open a model's settings to override them.",
'settings.providers.modelContextWindowNumberError': 'Enter an integer.',
'settings.providers.modelContextWindowRangeError': 'Must be between 16000 and 10000000.',
'settings.providers.testConnection': 'Test Connection',
Expand Down
3 changes: 2 additions & 1 deletion desktop/src/i18n/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ export const zh: Record<TranslationKey, string> = {
'settings.providers.sourceBuiltIn': '内置',
'settings.providers.sourceDiscovered': '提供方接口',
'settings.providers.sourceFallback': '通用默认值',
'settings.providers.sourceModelsDev': 'models.dev',
'settings.providers.restoreDefault': '恢复默认',
'settings.providers.restoreDefaultFor': '恢复默认:{field}',
'settings.providers.positiveIntegerError': '请输入正整数。',
Expand All @@ -558,7 +559,7 @@ export const zh: Record<TranslationKey, string> = {
'settings.providers.modelDiscoveryFailed': '没能从提供方读取模型信息:{error}',
'settings.providers.savedModelDiscoveryFailed': '已保存。已打开的会话在下次切换模型或重新开始后使用新的模型设置。没能从提供方读取模型信息:{error}',
'settings.providers.modelRulesApplyLater': '已保存。已打开的会话在下次切换模型或重新开始后使用新的模型设置。',
'settings.providers.modelRulesDesc': '每个模型按内置规则、从提供方读取的值或通用默认值运行。打开模型设置可以覆盖。',
'settings.providers.modelRulesDesc': '每个模型按 models.dev 的数据、内置规则、从提供方读取的值或通用默认值运行。打开模型设置可以覆盖。',
'settings.providers.modelContextWindowNumberError': '请输入整数。',
'settings.providers.modelContextWindowRangeError': '范围必须在 16000 到 10000000 之间。',
'settings.providers.testConnection': '测试连接',
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/types/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type ReasoningDialect =

export type ReasoningControl = 'none' | 'toggle' | 'effort' | 'toggle_effort' | 'always'

export type FieldSource = 'fallback' | 'format' | 'model' | 'site' | 'discovered' | 'user'
export type FieldSource = 'fallback' | 'format' | 'model' | 'modelsDev' | 'site' | 'discovered' | 'user'

export type InheritedSource = Exclude<FieldSource, 'format' | 'user'>

Expand Down
Loading
Loading