code-puppy 0.0.205__py3-none-any.whl → 0.0.207__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.
code_puppy/config.py CHANGED
@@ -132,6 +132,7 @@ def get_config_keys():
132
132
  "openai_reasoning_effort",
133
133
  "auto_save_session",
134
134
  "max_saved_sessions",
135
+ "http2",
135
136
  ]
136
137
  config = configparser.ConfigParser()
137
138
  config.read(CONFIG_FILE)
@@ -589,6 +590,27 @@ def get_compaction_strategy() -> str:
589
590
  return "truncation"
590
591
 
591
592
 
593
+ def get_http2() -> bool:
594
+ """
595
+ Get the http2 configuration value.
596
+ Returns False if not set (default).
597
+ """
598
+ val = get_value("http2")
599
+ if val is None:
600
+ return False
601
+ return str(val).lower() in ("1", "true", "yes", "on")
602
+
603
+
604
+ def set_http2(enabled: bool) -> None:
605
+ """
606
+ Sets the http2 configuration value.
607
+
608
+ Args:
609
+ enabled: Whether to enable HTTP/2 for httpx clients
610
+ """
611
+ set_config_value("http2", "true" if enabled else "false")
612
+
613
+
592
614
  def get_message_limit(default: int = 100) -> int:
593
615
  """
594
616
  Returns the user-configured message/request limit for the agent.
code_puppy/http_utils.py CHANGED
@@ -12,6 +12,8 @@ import httpx
12
12
  import requests
13
13
  from tenacity import stop_after_attempt, wait_exponential
14
14
 
15
+ from code_puppy.config import get_http2
16
+
15
17
  try:
16
18
  from pydantic_ai.retries import (
17
19
  AsyncTenacityTransport,
@@ -55,6 +57,9 @@ def create_client(
55
57
  if verify is None:
56
58
  verify = get_cert_bundle_path()
57
59
 
60
+ # Check if HTTP/2 is enabled in config
61
+ http2_enabled = get_http2()
62
+
58
63
  # If retry components are available, create a client with retry transport
59
64
  if TenacityTransport and RetryConfig and wait_retry_after:
60
65
 
@@ -81,11 +86,17 @@ def create_client(
81
86
  )
82
87
 
83
88
  return httpx.Client(
84
- transport=transport, verify=verify, headers=headers or {}, timeout=timeout
89
+ transport=transport,
90
+ verify=verify,
91
+ headers=headers or {},
92
+ timeout=timeout,
93
+ http2=http2_enabled,
85
94
  )
86
95
  else:
87
96
  # Fallback to regular client if retry components are not available
88
- return httpx.Client(verify=verify, headers=headers or {}, timeout=timeout)
97
+ return httpx.Client(
98
+ verify=verify, headers=headers or {}, timeout=timeout, http2=http2_enabled
99
+ )
89
100
 
90
101
 
91
102
  def create_async_client(
@@ -97,6 +108,9 @@ def create_async_client(
97
108
  if verify is None:
98
109
  verify = get_cert_bundle_path()
99
110
 
111
+ # Check if HTTP/2 is enabled in config
112
+ http2_enabled = get_http2()
113
+
100
114
  # If retry components are available, create a client with retry transport
101
115
  if AsyncTenacityTransport and RetryConfig and wait_retry_after:
102
116
 
@@ -120,11 +134,17 @@ def create_async_client(
120
134
  )
121
135
 
122
136
  return httpx.AsyncClient(
123
- transport=transport, verify=verify, headers=headers or {}, timeout=timeout
137
+ transport=transport,
138
+ verify=verify,
139
+ headers=headers or {},
140
+ timeout=timeout,
141
+ http2=http2_enabled,
124
142
  )
125
143
  else:
126
144
  # Fallback to regular client if retry components are not available
127
- return httpx.AsyncClient(verify=verify, headers=headers or {}, timeout=timeout)
145
+ return httpx.AsyncClient(
146
+ verify=verify, headers=headers or {}, timeout=timeout, http2=http2_enabled
147
+ )
128
148
 
129
149
 
130
150
  def create_requests_session(
@@ -176,6 +196,9 @@ def create_reopenable_async_client(
176
196
  if verify is None:
177
197
  verify = get_cert_bundle_path()
178
198
 
199
+ # Check if HTTP/2 is enabled in config
200
+ http2_enabled = get_http2()
201
+
179
202
  # If retry components are available, create a client with retry transport
180
203
  if AsyncTenacityTransport and RetryConfig and wait_retry_after:
181
204
 
@@ -207,6 +230,7 @@ def create_reopenable_async_client(
207
230
  verify=verify,
208
231
  headers=headers or {},
209
232
  timeout=timeout,
233
+ http2=http2_enabled,
210
234
  )
211
235
  else:
212
236
  # Fallback to regular AsyncClient if ReopenableAsyncClient is not available
@@ -215,17 +239,24 @@ def create_reopenable_async_client(
215
239
  verify=verify,
216
240
  headers=headers or {},
217
241
  timeout=timeout,
242
+ http2=http2_enabled,
218
243
  )
219
244
  else:
220
245
  # Fallback to regular clients if retry components are not available
221
246
  if ReopenableAsyncClient is not None:
222
247
  return ReopenableAsyncClient(
223
- verify=verify, headers=headers or {}, timeout=timeout
248
+ verify=verify,
249
+ headers=headers or {},
250
+ timeout=timeout,
251
+ http2=http2_enabled,
224
252
  )
225
253
  else:
226
254
  # Fallback to regular AsyncClient if ReopenableAsyncClient is not available
227
255
  return httpx.AsyncClient(
228
- verify=verify, headers=headers or {}, timeout=timeout
256
+ verify=verify,
257
+ headers=headers or {},
258
+ timeout=timeout,
259
+ http2=http2_enabled,
229
260
  )
230
261
 
231
262
 
code_puppy/models.json CHANGED
@@ -4,6 +4,42 @@
4
4
  "name": "gpt-5",
5
5
  "context_length": 400000
6
6
  },
7
+ "synthetic-DeepSeek-V3.1-Terminus": {
8
+ "type": "custom_openai",
9
+ "name": "hf:deepseek-ai/DeepSeek-V3.1-Terminus",
10
+ "custom_endpoint": {
11
+ "url": "https://api.synthetic.new/openai/v1/",
12
+ "api_key": "$SYN_API_KEY"
13
+ },
14
+ "context_length": 128000
15
+ },
16
+ "synthetic-Kimi-K2-Instruct-0905": {
17
+ "type": "custom_openai",
18
+ "name": "hf:moonshotai/Kimi-K2-Instruct-0905",
19
+ "custom_endpoint": {
20
+ "url": "https://api.synthetic.new/openai/v1/",
21
+ "api_key": "$SYN_API_KEY"
22
+ },
23
+ "context_length": 256000
24
+ },
25
+ "synthetic-Qwen3-Coder-480B-A35B-Instruct": {
26
+ "type": "custom_openai",
27
+ "name": "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct",
28
+ "custom_endpoint": {
29
+ "url": "https://api.synthetic.new/openai/v1/",
30
+ "api_key": "$SYN_API_KEY"
31
+ },
32
+ "context_length": 256000
33
+ },
34
+ "synthetic-GLM-4.6": {
35
+ "type": "custom_openai",
36
+ "name": "hf:zai-org/GLM-4.6",
37
+ "custom_endpoint": {
38
+ "url": "https://api.synthetic.new/openai/v1/",
39
+ "api_key": "$SYN_API_KEY"
40
+ },
41
+ "context_length": 200000
42
+ },
7
43
  "Cerebras-Qwen3-Coder-480b": {
8
44
  "type": "cerebras",
9
45
  "name": "qwen-3-coder-480b",
@@ -4,6 +4,42 @@
4
4
  "name": "gpt-5",
5
5
  "context_length": 400000
6
6
  },
7
+ "synthetic-DeepSeek-V3.1-Terminus": {
8
+ "type": "custom_openai",
9
+ "name": "hf:deepseek-ai/DeepSeek-V3.1-Terminus",
10
+ "custom_endpoint": {
11
+ "url": "https://api.synthetic.new/openai/v1/",
12
+ "api_key": "$SYN_API_KEY"
13
+ },
14
+ "context_length": 128000
15
+ },
16
+ "synthetic-Kimi-K2-Instruct-0905": {
17
+ "type": "custom_openai",
18
+ "name": "hf:moonshotai/Kimi-K2-Instruct-0905",
19
+ "custom_endpoint": {
20
+ "url": "https://api.synthetic.new/openai/v1/",
21
+ "api_key": "$SYN_API_KEY"
22
+ },
23
+ "context_length": 256000
24
+ },
25
+ "synthetic-Qwen3-Coder-480B-A35B-Instruct": {
26
+ "type": "custom_openai",
27
+ "name": "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct",
28
+ "custom_endpoint": {
29
+ "url": "https://api.synthetic.new/openai/v1/",
30
+ "api_key": "$SYN_API_KEY"
31
+ },
32
+ "context_length": 256000
33
+ },
34
+ "synthetic-GLM-4.6": {
35
+ "type": "custom_openai",
36
+ "name": "hf:zai-org/GLM-4.6",
37
+ "custom_endpoint": {
38
+ "url": "https://api.synthetic.new/openai/v1/",
39
+ "api_key": "$SYN_API_KEY"
40
+ },
41
+ "context_length": 200000
42
+ },
7
43
  "Cerebras-Qwen3-Coder-480b": {
8
44
  "type": "cerebras",
9
45
  "name": "qwen-3-coder-480b",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-puppy
3
- Version: 0.0.205
3
+ Version: 0.0.207
4
4
  Summary: Code generation agent
5
5
  Project-URL: repository, https://github.com/mpfaffenberger/code_puppy
6
6
  Project-URL: HomePage, https://github.com/mpfaffenberger/code_puppy
@@ -19,7 +19,7 @@ Requires-Dist: bs4>=0.0.2
19
19
  Requires-Dist: camoufox>=0.4.11
20
20
  Requires-Dist: fastapi>=0.110.0
21
21
  Requires-Dist: httpx-limiter>=0.3.0
22
- Requires-Dist: httpx>=0.24.1
22
+ Requires-Dist: httpx[http2]>=0.24.1
23
23
  Requires-Dist: json-repair>=0.46.2
24
24
  Requires-Dist: logfire>=0.7.1
25
25
  Requires-Dist: openai>=1.99.1
@@ -97,8 +97,7 @@ Code Puppy is an AI-powered code generation agent, designed to understand progra
97
97
  export MODEL_NAME=gpt-5 # or gemini-2.5-flash-preview-05-20 as an example for Google Gemini models
98
98
  export OPENAI_API_KEY=<your_openai_api_key> # or GEMINI_API_KEY for Google Gemini models
99
99
  export CEREBRAS_API_KEY=<your_cerebras_api_key> # for Cerebras models
100
- export YOLO_MODE=true # to bypass the safety confirmation prompt when running shell commands
101
-
100
+ export SYN_API_KEY=<your https://dev.synthetic.new api key> # for Synthetic provider
102
101
  # or ...
103
102
 
104
103
  export AZURE_OPENAI_API_KEY=...
@@ -107,6 +106,17 @@ export AZURE_OPENAI_ENDPOINT=...
107
106
  code-puppy --interactive
108
107
  ```
109
108
 
109
+ ### Synthetic Provider
110
+
111
+ Code Puppy supports the **Synthetic provider**, which gives you access to various open-source models through a custom OpenAI-compatible endpoint. Set `SYN_API_KEY` to use models like:
112
+
113
+ - `synthetic-DeepSeek-V3.1-Terminus` (128K context)
114
+ - `synthetic-Kimi-K2-Instruct-0905` (256K context)
115
+ - `synthetic-Qwen3-Coder-480B-A35B-Instruct` (256K context)
116
+ - `synthetic-GLM-4.6` (200K context)
117
+
118
+ These models are available via `https://api.synthetic.new/openai/v1/` and provide high-quality coding assistance with generous context windows.
119
+
110
120
  Run specific tasks or engage in interactive mode:
111
121
 
112
122
  ```bash
@@ -1,11 +1,11 @@
1
1
  code_puppy/__init__.py,sha256=ehbM1-wMjNmOXk_DBhhJECFyBv2dRHwwo7ucjHeM68E,107
2
2
  code_puppy/__main__.py,sha256=pDVssJOWP8A83iFkxMLY9YteHYat0EyWDQqMkKHpWp4,203
3
3
  code_puppy/callbacks.py,sha256=ukSgVFaEO68o6J09qFwDrnmNanrVv3toTLQhS504Meo,6162
4
- code_puppy/config.py,sha256=xT-nU1U4n7u8pyzJPG18-cJZBKv5OZI2CtHLt9DGRzU,26065
5
- code_puppy/http_utils.py,sha256=YLd8Y16idbI32JGeBXG8n5rT4o4X_zxk9FgUvK9XFo8,8248
4
+ code_puppy/config.py,sha256=Oo24Z5Abos6Nx7Ho8UVmIPbeCQDlObOdsM8zpYxcLKs,26561
5
+ code_puppy/http_utils.py,sha256=Hd9bx0nWTmCSRSQxMYF4Hh91bYB1zghqaheNRhHxabM,8957
6
6
  code_puppy/main.py,sha256=SUh2UNbbEwVWSQwDkz-xBp80Q8qenX7tItsEEopcZfI,24024
7
7
  code_puppy/model_factory.py,sha256=ZbIAJWMNKNdTCEMQK8Ig6TDDZlVNyGO9hOLHoLLPMYw,15397
8
- code_puppy/models.json,sha256=dppxeQ43J5aDl-5Ytr9Rq31tiEpcQndgDVTuF1Csr_g,1751
8
+ code_puppy/models.json,sha256=iZjnV2kZ2ri9eICeVLAoSC_zyUPpWp9G2AHR8QsbfDs,2815
9
9
  code_puppy/reopenable_async_client.py,sha256=4UJRaMp5np8cbef9F0zKQ7TPKOfyf5U-Kv-0zYUWDho,8274
10
10
  code_puppy/round_robin_model.py,sha256=UEfw-Ix7GpNRWSxxuJtA-EE4_A46KXjMgFRciprfLmg,5634
11
11
  code_puppy/session_storage.py,sha256=Pf5C-qyC6xLhZCTlbAdkPwOFyqlaDomVnj9Z4cZcZsE,9595
@@ -123,9 +123,9 @@ code_puppy/tui/screens/help.py,sha256=eJuPaOOCp7ZSUlecearqsuX6caxWv7NQszUh0tZJjB
123
123
  code_puppy/tui/screens/mcp_install_wizard.py,sha256=vObpQwLbXjQsxmSg-WCasoev1usEi0pollKnL0SHu9U,27693
124
124
  code_puppy/tui/screens/settings.py,sha256=EoMxiguyeF0srwV1bj4_MG9rrxkNthh6TdTNsxnXLfE,11460
125
125
  code_puppy/tui/screens/tools.py,sha256=3pr2Xkpa9Js6Yhf1A3_wQVRzFOui-KDB82LwrsdBtyk,1715
126
- code_puppy-0.0.205.data/data/code_puppy/models.json,sha256=dppxeQ43J5aDl-5Ytr9Rq31tiEpcQndgDVTuF1Csr_g,1751
127
- code_puppy-0.0.205.dist-info/METADATA,sha256=k7rTavcaOz2Wc2VAf_Fy0dBaRuI0qQUXMAYK8Htumew,20759
128
- code_puppy-0.0.205.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
129
- code_puppy-0.0.205.dist-info/entry_points.txt,sha256=Tp4eQC99WY3HOKd3sdvb22vZODRq0XkZVNpXOag_KdI,91
130
- code_puppy-0.0.205.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
131
- code_puppy-0.0.205.dist-info/RECORD,,
126
+ code_puppy-0.0.207.data/data/code_puppy/models.json,sha256=iZjnV2kZ2ri9eICeVLAoSC_zyUPpWp9G2AHR8QsbfDs,2815
127
+ code_puppy-0.0.207.dist-info/METADATA,sha256=PghZVcf5eykKl5woyejWaSlLx-BYSmr8syp6TxfSrfI,21312
128
+ code_puppy-0.0.207.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
129
+ code_puppy-0.0.207.dist-info/entry_points.txt,sha256=Tp4eQC99WY3HOKd3sdvb22vZODRq0XkZVNpXOag_KdI,91
130
+ code_puppy-0.0.207.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
131
+ code_puppy-0.0.207.dist-info/RECORD,,