klaude-code 1.2.6__py3-none-any.whl → 1.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- klaude_code/auth/__init__.py +24 -0
- klaude_code/auth/codex/__init__.py +20 -0
- klaude_code/auth/codex/exceptions.py +17 -0
- klaude_code/auth/codex/jwt_utils.py +45 -0
- klaude_code/auth/codex/oauth.py +229 -0
- klaude_code/auth/codex/token_manager.py +84 -0
- klaude_code/cli/auth_cmd.py +73 -0
- klaude_code/cli/config_cmd.py +91 -0
- klaude_code/cli/cost_cmd.py +338 -0
- klaude_code/cli/debug.py +78 -0
- klaude_code/cli/list_model.py +307 -0
- klaude_code/cli/main.py +233 -134
- klaude_code/cli/runtime.py +309 -117
- klaude_code/{version.py → cli/self_update.py} +114 -5
- klaude_code/cli/session_cmd.py +37 -21
- klaude_code/command/__init__.py +88 -27
- klaude_code/command/clear_cmd.py +8 -7
- klaude_code/command/command_abc.py +31 -31
- klaude_code/command/debug_cmd.py +79 -0
- klaude_code/command/export_cmd.py +19 -53
- klaude_code/command/export_online_cmd.py +154 -0
- klaude_code/command/fork_session_cmd.py +267 -0
- klaude_code/command/help_cmd.py +7 -8
- klaude_code/command/model_cmd.py +60 -10
- klaude_code/command/model_select.py +84 -0
- klaude_code/command/prompt-jj-describe.md +32 -0
- klaude_code/command/prompt_command.py +19 -11
- klaude_code/command/refresh_cmd.py +8 -10
- klaude_code/command/registry.py +139 -40
- klaude_code/command/release_notes_cmd.py +84 -0
- klaude_code/command/resume_cmd.py +111 -0
- klaude_code/command/status_cmd.py +104 -60
- klaude_code/command/terminal_setup_cmd.py +7 -9
- klaude_code/command/thinking_cmd.py +98 -0
- klaude_code/config/__init__.py +14 -6
- klaude_code/config/assets/__init__.py +1 -0
- klaude_code/config/assets/builtin_config.yaml +303 -0
- klaude_code/config/builtin_config.py +38 -0
- klaude_code/config/config.py +378 -109
- klaude_code/config/select_model.py +117 -53
- klaude_code/config/thinking.py +269 -0
- klaude_code/{const/__init__.py → const.py} +50 -19
- klaude_code/core/agent.py +20 -28
- klaude_code/core/executor.py +327 -112
- klaude_code/core/manager/__init__.py +2 -4
- klaude_code/core/manager/llm_clients.py +1 -15
- klaude_code/core/manager/llm_clients_builder.py +10 -11
- klaude_code/core/manager/sub_agent_manager.py +37 -6
- klaude_code/core/prompt.py +63 -44
- klaude_code/core/prompts/prompt-claude-code.md +2 -13
- klaude_code/core/prompts/prompt-codex-gpt-5-1-codex-max.md +117 -0
- klaude_code/core/prompts/prompt-codex-gpt-5-2-codex.md +117 -0
- klaude_code/core/prompts/prompt-codex.md +9 -42
- klaude_code/core/prompts/prompt-minimal.md +12 -0
- klaude_code/core/prompts/{prompt-subagent-explore.md → prompt-sub-agent-explore.md} +16 -3
- klaude_code/core/prompts/{prompt-subagent-oracle.md → prompt-sub-agent-oracle.md} +1 -2
- klaude_code/core/prompts/prompt-sub-agent-web.md +51 -0
- klaude_code/core/reminders.py +283 -95
- klaude_code/core/task.py +113 -75
- klaude_code/core/tool/__init__.py +24 -31
- klaude_code/core/tool/file/_utils.py +36 -0
- klaude_code/core/tool/file/apply_patch.py +17 -25
- klaude_code/core/tool/file/apply_patch_tool.py +57 -77
- klaude_code/core/tool/file/diff_builder.py +151 -0
- klaude_code/core/tool/file/edit_tool.py +50 -63
- klaude_code/core/tool/file/move_tool.md +41 -0
- klaude_code/core/tool/file/move_tool.py +435 -0
- klaude_code/core/tool/file/read_tool.md +1 -1
- klaude_code/core/tool/file/read_tool.py +86 -86
- klaude_code/core/tool/file/write_tool.py +59 -69
- klaude_code/core/tool/report_back_tool.py +84 -0
- klaude_code/core/tool/shell/bash_tool.py +265 -22
- klaude_code/core/tool/shell/command_safety.py +3 -6
- klaude_code/core/tool/{memory → skill}/skill_tool.py +16 -26
- klaude_code/core/tool/sub_agent_tool.py +13 -2
- klaude_code/core/tool/todo/todo_write_tool.md +0 -157
- klaude_code/core/tool/todo/todo_write_tool.py +1 -1
- klaude_code/core/tool/todo/todo_write_tool_raw.md +182 -0
- klaude_code/core/tool/todo/update_plan_tool.py +1 -1
- klaude_code/core/tool/tool_abc.py +18 -0
- klaude_code/core/tool/tool_context.py +27 -12
- klaude_code/core/tool/tool_registry.py +7 -7
- klaude_code/core/tool/tool_runner.py +44 -36
- klaude_code/core/tool/truncation.py +29 -14
- klaude_code/core/tool/web/mermaid_tool.md +43 -0
- klaude_code/core/tool/web/mermaid_tool.py +2 -5
- klaude_code/core/tool/web/web_fetch_tool.md +1 -1
- klaude_code/core/tool/web/web_fetch_tool.py +112 -22
- klaude_code/core/tool/web/web_search_tool.md +23 -0
- klaude_code/core/tool/web/web_search_tool.py +130 -0
- klaude_code/core/turn.py +168 -66
- klaude_code/llm/__init__.py +2 -10
- klaude_code/llm/anthropic/client.py +190 -178
- klaude_code/llm/anthropic/input.py +39 -15
- klaude_code/llm/bedrock/__init__.py +3 -0
- klaude_code/llm/bedrock/client.py +60 -0
- klaude_code/llm/client.py +7 -21
- klaude_code/llm/codex/__init__.py +5 -0
- klaude_code/llm/codex/client.py +149 -0
- klaude_code/llm/google/__init__.py +3 -0
- klaude_code/llm/google/client.py +309 -0
- klaude_code/llm/google/input.py +215 -0
- klaude_code/llm/input_common.py +3 -9
- klaude_code/llm/openai_compatible/client.py +72 -164
- klaude_code/llm/openai_compatible/input.py +6 -4
- klaude_code/llm/openai_compatible/stream.py +273 -0
- klaude_code/llm/openai_compatible/tool_call_accumulator.py +17 -1
- klaude_code/llm/openrouter/client.py +89 -160
- klaude_code/llm/openrouter/input.py +18 -30
- klaude_code/llm/openrouter/reasoning.py +118 -0
- klaude_code/llm/registry.py +39 -7
- klaude_code/llm/responses/client.py +184 -171
- klaude_code/llm/responses/input.py +20 -1
- klaude_code/llm/usage.py +17 -12
- klaude_code/protocol/commands.py +17 -1
- klaude_code/protocol/events.py +31 -4
- klaude_code/protocol/llm_param.py +13 -10
- klaude_code/protocol/model.py +232 -29
- klaude_code/protocol/op.py +90 -1
- klaude_code/protocol/op_handler.py +35 -1
- klaude_code/protocol/sub_agent/__init__.py +117 -0
- klaude_code/protocol/sub_agent/explore.py +63 -0
- klaude_code/protocol/sub_agent/oracle.py +91 -0
- klaude_code/protocol/sub_agent/task.py +61 -0
- klaude_code/protocol/sub_agent/web.py +79 -0
- klaude_code/protocol/tools.py +4 -2
- klaude_code/session/__init__.py +2 -2
- klaude_code/session/codec.py +71 -0
- klaude_code/session/export.py +293 -86
- klaude_code/session/selector.py +89 -67
- klaude_code/session/session.py +320 -309
- klaude_code/session/store.py +220 -0
- klaude_code/session/templates/export_session.html +595 -83
- klaude_code/session/templates/mermaid_viewer.html +926 -0
- klaude_code/skill/__init__.py +27 -0
- klaude_code/skill/assets/deslop/SKILL.md +17 -0
- klaude_code/skill/assets/dev-docs/SKILL.md +108 -0
- klaude_code/skill/assets/handoff/SKILL.md +39 -0
- klaude_code/skill/assets/jj-workspace/SKILL.md +20 -0
- klaude_code/skill/assets/skill-creator/SKILL.md +139 -0
- klaude_code/{core/tool/memory/skill_loader.py → skill/loader.py} +55 -15
- klaude_code/skill/manager.py +70 -0
- klaude_code/skill/system_skills.py +192 -0
- klaude_code/trace/__init__.py +20 -2
- klaude_code/trace/log.py +150 -5
- klaude_code/ui/__init__.py +4 -9
- klaude_code/ui/core/input.py +1 -1
- klaude_code/ui/core/stage_manager.py +7 -7
- klaude_code/ui/modes/debug/display.py +2 -1
- klaude_code/ui/modes/repl/__init__.py +3 -48
- klaude_code/ui/modes/repl/clipboard.py +5 -5
- klaude_code/ui/modes/repl/completers.py +487 -123
- klaude_code/ui/modes/repl/display.py +5 -4
- klaude_code/ui/modes/repl/event_handler.py +370 -117
- klaude_code/ui/modes/repl/input_prompt_toolkit.py +552 -105
- klaude_code/ui/modes/repl/key_bindings.py +146 -23
- klaude_code/ui/modes/repl/renderer.py +189 -99
- klaude_code/ui/renderers/assistant.py +9 -2
- klaude_code/ui/renderers/bash_syntax.py +178 -0
- klaude_code/ui/renderers/common.py +78 -0
- klaude_code/ui/renderers/developer.py +104 -48
- klaude_code/ui/renderers/diffs.py +87 -6
- klaude_code/ui/renderers/errors.py +11 -6
- klaude_code/ui/renderers/mermaid_viewer.py +57 -0
- klaude_code/ui/renderers/metadata.py +112 -76
- klaude_code/ui/renderers/sub_agent.py +92 -7
- klaude_code/ui/renderers/thinking.py +40 -18
- klaude_code/ui/renderers/tools.py +405 -227
- klaude_code/ui/renderers/user_input.py +73 -13
- klaude_code/ui/rich/__init__.py +10 -1
- klaude_code/ui/rich/cjk_wrap.py +228 -0
- klaude_code/ui/rich/code_panel.py +131 -0
- klaude_code/ui/rich/live.py +17 -0
- klaude_code/ui/rich/markdown.py +305 -170
- klaude_code/ui/rich/searchable_text.py +10 -13
- klaude_code/ui/rich/status.py +190 -49
- klaude_code/ui/rich/theme.py +135 -39
- klaude_code/ui/terminal/__init__.py +55 -0
- klaude_code/ui/terminal/color.py +1 -1
- klaude_code/ui/terminal/control.py +13 -22
- klaude_code/ui/terminal/notifier.py +44 -4
- klaude_code/ui/terminal/selector.py +658 -0
- klaude_code/ui/utils/common.py +0 -18
- klaude_code-1.8.0.dist-info/METADATA +377 -0
- klaude_code-1.8.0.dist-info/RECORD +219 -0
- {klaude_code-1.2.6.dist-info → klaude_code-1.8.0.dist-info}/entry_points.txt +1 -0
- klaude_code/command/diff_cmd.py +0 -138
- klaude_code/command/prompt-dev-docs-update.md +0 -56
- klaude_code/command/prompt-dev-docs.md +0 -46
- klaude_code/config/list_model.py +0 -162
- klaude_code/core/manager/agent_manager.py +0 -127
- klaude_code/core/prompts/prompt-subagent-webfetch.md +0 -46
- klaude_code/core/tool/file/multi_edit_tool.md +0 -42
- klaude_code/core/tool/file/multi_edit_tool.py +0 -199
- klaude_code/core/tool/memory/memory_tool.md +0 -16
- klaude_code/core/tool/memory/memory_tool.py +0 -462
- klaude_code/llm/openrouter/reasoning_handler.py +0 -209
- klaude_code/protocol/sub_agent.py +0 -348
- klaude_code/ui/utils/debouncer.py +0 -42
- klaude_code-1.2.6.dist-info/METADATA +0 -178
- klaude_code-1.2.6.dist-info/RECORD +0 -167
- /klaude_code/core/prompts/{prompt-subagent.md → prompt-sub-agent.md} +0 -0
- /klaude_code/core/tool/{memory → skill}/__init__.py +0 -0
- /klaude_code/core/tool/{memory → skill}/skill_tool.md +0 -0
- {klaude_code-1.2.6.dist-info → klaude_code-1.8.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# Built-in provider and model configurations
|
|
2
|
+
# Users can start using klaude by simply setting environment variables
|
|
3
|
+
# (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) without manual configuration.
|
|
4
|
+
|
|
5
|
+
provider_list:
|
|
6
|
+
- provider_name: anthropic
|
|
7
|
+
protocol: anthropic
|
|
8
|
+
api_key: ${ANTHROPIC_API_KEY}
|
|
9
|
+
model_list:
|
|
10
|
+
- model_name: sonnet@ant
|
|
11
|
+
model_params:
|
|
12
|
+
model: claude-sonnet-4-5-20250929
|
|
13
|
+
context_limit: 200000
|
|
14
|
+
provider_routing:
|
|
15
|
+
sort: throughput
|
|
16
|
+
cost:
|
|
17
|
+
input: 3.0
|
|
18
|
+
output: 15.0
|
|
19
|
+
cache_read: 0.3
|
|
20
|
+
cache_write: 3.75
|
|
21
|
+
- model_name: opus@ant
|
|
22
|
+
model_params:
|
|
23
|
+
model: claude-opus-4-5-20251101
|
|
24
|
+
context_limit: 200000
|
|
25
|
+
verbosity: high
|
|
26
|
+
thinking:
|
|
27
|
+
type: enabled
|
|
28
|
+
budget_tokens: 2048
|
|
29
|
+
cost:
|
|
30
|
+
input: 5.0
|
|
31
|
+
output: 25.0
|
|
32
|
+
cache_read: 0.5
|
|
33
|
+
cache_write: 6.25
|
|
34
|
+
|
|
35
|
+
- provider_name: openai
|
|
36
|
+
protocol: responses
|
|
37
|
+
api_key: ${OPENAI_API_KEY}
|
|
38
|
+
model_list:
|
|
39
|
+
- model_name: gpt-5.2
|
|
40
|
+
model_params:
|
|
41
|
+
model: gpt-5.2
|
|
42
|
+
max_tokens: 128000
|
|
43
|
+
context_limit: 400000
|
|
44
|
+
verbosity: high
|
|
45
|
+
thinking:
|
|
46
|
+
reasoning_effort: high
|
|
47
|
+
cost:
|
|
48
|
+
input: 1.75
|
|
49
|
+
output: 14.0
|
|
50
|
+
cache_read: 0.17
|
|
51
|
+
|
|
52
|
+
- provider_name: openrouter
|
|
53
|
+
protocol: openrouter
|
|
54
|
+
api_key: ${OPENROUTER_API_KEY}
|
|
55
|
+
model_list:
|
|
56
|
+
- model_name: gpt-5-mini
|
|
57
|
+
model_params:
|
|
58
|
+
model: openai/gpt-5-mini
|
|
59
|
+
max_tokens: 128000
|
|
60
|
+
context_limit: 400000
|
|
61
|
+
thinking:
|
|
62
|
+
reasoning_effort: high
|
|
63
|
+
cost:
|
|
64
|
+
input: 0.25
|
|
65
|
+
output: 2.0
|
|
66
|
+
cache_read: 0.03
|
|
67
|
+
- model_name: gpt-5.1-codex-max
|
|
68
|
+
model_params:
|
|
69
|
+
model: openai/gpt-5.1-codex-max
|
|
70
|
+
max_tokens: 128000
|
|
71
|
+
context_limit: 400000
|
|
72
|
+
thinking:
|
|
73
|
+
reasoning_effort: medium
|
|
74
|
+
cost:
|
|
75
|
+
input: 1.25
|
|
76
|
+
output: 10.0
|
|
77
|
+
cache_read: 0.13
|
|
78
|
+
- model_name: gpt-5.2
|
|
79
|
+
model_params:
|
|
80
|
+
model: openai/gpt-5.2
|
|
81
|
+
max_tokens: 128000
|
|
82
|
+
context_limit: 400000
|
|
83
|
+
verbosity: high
|
|
84
|
+
thinking:
|
|
85
|
+
reasoning_effort: high
|
|
86
|
+
cost:
|
|
87
|
+
input: 1.75
|
|
88
|
+
output: 14.0
|
|
89
|
+
cache_read: 0.17
|
|
90
|
+
- model_name: gpt-5.2-medium
|
|
91
|
+
model_params:
|
|
92
|
+
model: openai/gpt-5.2
|
|
93
|
+
max_tokens: 128000
|
|
94
|
+
context_limit: 400000
|
|
95
|
+
verbosity: high
|
|
96
|
+
thinking:
|
|
97
|
+
reasoning_effort: medium
|
|
98
|
+
cost:
|
|
99
|
+
input: 1.75
|
|
100
|
+
output: 14.0
|
|
101
|
+
cache_read: 0.17
|
|
102
|
+
- model_name: gpt-5.2-low
|
|
103
|
+
model_params:
|
|
104
|
+
model: openai/gpt-5.2
|
|
105
|
+
max_tokens: 128000
|
|
106
|
+
context_limit: 400000
|
|
107
|
+
verbosity: low
|
|
108
|
+
thinking:
|
|
109
|
+
reasoning_effort: low
|
|
110
|
+
cost:
|
|
111
|
+
input: 1.75
|
|
112
|
+
output: 14.0
|
|
113
|
+
cache_read: 0.17
|
|
114
|
+
- model_name: gpt-5.2-fast
|
|
115
|
+
model_params:
|
|
116
|
+
model: openai/gpt-5.2
|
|
117
|
+
max_tokens: 128000
|
|
118
|
+
context_limit: 400000
|
|
119
|
+
verbosity: low
|
|
120
|
+
thinking:
|
|
121
|
+
reasoning_effort: none
|
|
122
|
+
cost:
|
|
123
|
+
input: 1.75
|
|
124
|
+
output: 14.0
|
|
125
|
+
cache_read: 0.17
|
|
126
|
+
- model_name: kimi
|
|
127
|
+
model_params:
|
|
128
|
+
model: moonshotai/kimi-k2-thinking
|
|
129
|
+
context_limit: 262144
|
|
130
|
+
provider_routing:
|
|
131
|
+
only:
|
|
132
|
+
- moonshotai/turbo
|
|
133
|
+
cost:
|
|
134
|
+
input: 0.6
|
|
135
|
+
output: 2.5
|
|
136
|
+
cache_read: 0.15
|
|
137
|
+
- model_name: haiku
|
|
138
|
+
model_params:
|
|
139
|
+
model: anthropic/claude-haiku-4.5
|
|
140
|
+
context_limit: 200000
|
|
141
|
+
cost:
|
|
142
|
+
input: 1.0
|
|
143
|
+
output: 5.0
|
|
144
|
+
cache_read: 0.1
|
|
145
|
+
cache_write: 1.25
|
|
146
|
+
- model_name: sonnet
|
|
147
|
+
model_params:
|
|
148
|
+
model: anthropic/claude-4.5-sonnet
|
|
149
|
+
context_limit: 200000
|
|
150
|
+
provider_routing:
|
|
151
|
+
sort: throughput
|
|
152
|
+
cost:
|
|
153
|
+
input: 3.0
|
|
154
|
+
output: 15.0
|
|
155
|
+
cache_read: 0.3
|
|
156
|
+
cache_write: 3.75
|
|
157
|
+
- model_name: opus
|
|
158
|
+
model_params:
|
|
159
|
+
model: anthropic/claude-4.5-opus
|
|
160
|
+
context_limit: 200000
|
|
161
|
+
verbosity: high
|
|
162
|
+
thinking:
|
|
163
|
+
type: enabled
|
|
164
|
+
budget_tokens: 2048
|
|
165
|
+
cost:
|
|
166
|
+
input: 5.0
|
|
167
|
+
output: 25.0
|
|
168
|
+
cache_read: 0.5
|
|
169
|
+
cache_write: 6.25
|
|
170
|
+
- model_name: gemini-pro
|
|
171
|
+
model_params:
|
|
172
|
+
model: google/gemini-3-pro-preview
|
|
173
|
+
context_limit: 1048576
|
|
174
|
+
thinking:
|
|
175
|
+
reasoning_effort: high
|
|
176
|
+
cost:
|
|
177
|
+
input: 2.0
|
|
178
|
+
output: 12.0
|
|
179
|
+
cache_read: 0.2
|
|
180
|
+
- model_name: gemini-flash
|
|
181
|
+
model_params:
|
|
182
|
+
model: google/gemini-3-flash-preview
|
|
183
|
+
context_limit: 1048576
|
|
184
|
+
thinking:
|
|
185
|
+
reasoning_effort: medium
|
|
186
|
+
cost:
|
|
187
|
+
input: 0.5
|
|
188
|
+
output: 3.0
|
|
189
|
+
cache_read: 0.05
|
|
190
|
+
- model_name: grok
|
|
191
|
+
model_params:
|
|
192
|
+
model: x-ai/grok-4.1-fast
|
|
193
|
+
context_limit: 2000000
|
|
194
|
+
thinking:
|
|
195
|
+
type: enabled
|
|
196
|
+
budget_tokens: 2048
|
|
197
|
+
cost:
|
|
198
|
+
input: 0.2
|
|
199
|
+
output: 0.5
|
|
200
|
+
cache_read: 0.05
|
|
201
|
+
- model_name: minimax
|
|
202
|
+
model_params:
|
|
203
|
+
model: minimax/minimax-m2.1
|
|
204
|
+
context_limit: 204800
|
|
205
|
+
cost:
|
|
206
|
+
input: 0.3
|
|
207
|
+
output: 1.2
|
|
208
|
+
cache_read: 0.03
|
|
209
|
+
- model_name: glm
|
|
210
|
+
model_params:
|
|
211
|
+
model: z-ai/glm-4.7
|
|
212
|
+
context_limit: 200000
|
|
213
|
+
provider_routing:
|
|
214
|
+
only:
|
|
215
|
+
- z-ai
|
|
216
|
+
cost:
|
|
217
|
+
input: 0.44
|
|
218
|
+
output: 1.74
|
|
219
|
+
cache_read: 0.04
|
|
220
|
+
|
|
221
|
+
- provider_name: google
|
|
222
|
+
protocol: google
|
|
223
|
+
api_key: ${GOOGLE_API_KEY}
|
|
224
|
+
model_list:
|
|
225
|
+
- model_name: gemini-pro@google
|
|
226
|
+
model_params:
|
|
227
|
+
model: gemini-3-pro-preview
|
|
228
|
+
context_limit: 1048576
|
|
229
|
+
cost:
|
|
230
|
+
input: 2.0
|
|
231
|
+
output: 12.0
|
|
232
|
+
cache_read: 0.2
|
|
233
|
+
- model_name: gemini-flash@google
|
|
234
|
+
model_params:
|
|
235
|
+
model: gemini-3-flash-preview
|
|
236
|
+
context_limit: 1048576
|
|
237
|
+
cost:
|
|
238
|
+
input: 0.5
|
|
239
|
+
output: 3.0
|
|
240
|
+
cache_read: 0.05
|
|
241
|
+
- provider_name: bedrock
|
|
242
|
+
protocol: bedrock
|
|
243
|
+
aws_access_key: ${AWS_ACCESS_KEY_ID}
|
|
244
|
+
aws_secret_key: ${AWS_SECRET_ACCESS_KEY}
|
|
245
|
+
aws_region: ${AWS_REGION}
|
|
246
|
+
model_list:
|
|
247
|
+
- model_name: sonnet@bedrock
|
|
248
|
+
model_params:
|
|
249
|
+
model: us.anthropic.claude-sonnet-4-5-20250929-v1:0
|
|
250
|
+
context_limit: 200000
|
|
251
|
+
cost:
|
|
252
|
+
input: 3.0
|
|
253
|
+
output: 15.0
|
|
254
|
+
cache_read: 0.3
|
|
255
|
+
cache_write: 3.75
|
|
256
|
+
- provider_name: deepseek
|
|
257
|
+
protocol: anthropic
|
|
258
|
+
api_key: ${DEEPSEEK_API_KEY}
|
|
259
|
+
base_url: https://api.deepseek.com/anthropic
|
|
260
|
+
model_list:
|
|
261
|
+
- model_name: deepseek
|
|
262
|
+
provider: deepseek
|
|
263
|
+
model_params:
|
|
264
|
+
model: deepseek-reasoner
|
|
265
|
+
context_limit: 128000
|
|
266
|
+
thinking:
|
|
267
|
+
type: enabled
|
|
268
|
+
budget_tokens: 2048
|
|
269
|
+
cost:
|
|
270
|
+
input: 2
|
|
271
|
+
output: 3
|
|
272
|
+
cache_read: 0.2
|
|
273
|
+
currency: CNY
|
|
274
|
+
|
|
275
|
+
- provider_name: moonshot
|
|
276
|
+
protocol: anthropic
|
|
277
|
+
api_key: ${MOONSHOT_API_KEY}
|
|
278
|
+
base_url: https://api.moonshot.cn/anthropic
|
|
279
|
+
model_list:
|
|
280
|
+
- model_name: kimi@moonshot
|
|
281
|
+
model_params:
|
|
282
|
+
model: kimi-k2-thinking
|
|
283
|
+
context_limit: 262144
|
|
284
|
+
thinking:
|
|
285
|
+
type: enabled
|
|
286
|
+
budget_tokens: 8192
|
|
287
|
+
cost:
|
|
288
|
+
input: 4.0
|
|
289
|
+
output: 16.0
|
|
290
|
+
cache_read: 1.0
|
|
291
|
+
currency: CNY
|
|
292
|
+
|
|
293
|
+
- provider_name: codex
|
|
294
|
+
protocol: codex
|
|
295
|
+
model_list:
|
|
296
|
+
- model_name: gpt-5.2-codex
|
|
297
|
+
provider: codex
|
|
298
|
+
model_params:
|
|
299
|
+
model: gpt-5.2-codex
|
|
300
|
+
thinking:
|
|
301
|
+
reasoning_effort: medium
|
|
302
|
+
context_limit: 400000
|
|
303
|
+
max_tokens: 128000
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Built-in provider and model configurations.
|
|
2
|
+
|
|
3
|
+
These configurations allow users to start using klaude by simply setting
|
|
4
|
+
environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) without
|
|
5
|
+
manually configuring providers.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from functools import lru_cache
|
|
9
|
+
from importlib import resources
|
|
10
|
+
from typing import TYPE_CHECKING
|
|
11
|
+
|
|
12
|
+
import yaml
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from klaude_code.config.config import ProviderConfig
|
|
16
|
+
|
|
17
|
+
# All supported API key environment variables
|
|
18
|
+
SUPPORTED_API_KEY_ENVS = [
|
|
19
|
+
"ANTHROPIC_API_KEY",
|
|
20
|
+
"GOOGLE_API_KEY",
|
|
21
|
+
"OPENAI_API_KEY",
|
|
22
|
+
"OPENROUTER_API_KEY",
|
|
23
|
+
"DEEPSEEK_API_KEY",
|
|
24
|
+
"MOONSHOT_API_KEY",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@lru_cache(maxsize=1)
|
|
29
|
+
def get_builtin_provider_configs() -> list["ProviderConfig"]:
|
|
30
|
+
"""Load built-in provider configurations from YAML asset."""
|
|
31
|
+
# Import here to avoid circular import
|
|
32
|
+
from klaude_code.config.config import ProviderConfig
|
|
33
|
+
|
|
34
|
+
assets = resources.files("klaude_code.config.assets")
|
|
35
|
+
yaml_content = (assets / "builtin_config.yaml").read_text()
|
|
36
|
+
data = yaml.safe_load(yaml_content)
|
|
37
|
+
|
|
38
|
+
return [ProviderConfig.model_validate(p) for p in data.get("provider_list", [])]
|