gac 1.7.0__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.
Potentially problematic release.
This version of gac might be problematic. Click here for more details.
- gac/__version__.py +1 -1
- gac/ai.py +2 -0
- gac/ai_utils.py +1 -1
- gac/init_cli.py +2 -1
- gac/providers/__init__.py +2 -0
- gac/providers/chutes.py +71 -0
- {gac-1.7.0.dist-info → gac-1.8.0.dist-info}/METADATA +2 -8
- {gac-1.7.0.dist-info → gac-1.8.0.dist-info}/RECORD +11 -10
- {gac-1.7.0.dist-info → gac-1.8.0.dist-info}/WHEEL +0 -0
- {gac-1.7.0.dist-info → gac-1.8.0.dist-info}/entry_points.txt +0 -0
- {gac-1.7.0.dist-info → gac-1.8.0.dist-info}/licenses/LICENSE +0 -0
gac/__version__.py
CHANGED
gac/ai.py
CHANGED
|
@@ -12,6 +12,7 @@ from gac.errors import AIError
|
|
|
12
12
|
from gac.providers import (
|
|
13
13
|
call_anthropic_api,
|
|
14
14
|
call_cerebras_api,
|
|
15
|
+
call_chutes_api,
|
|
15
16
|
call_gemini_api,
|
|
16
17
|
call_groq_api,
|
|
17
18
|
call_lmstudio_api,
|
|
@@ -69,6 +70,7 @@ def generate_commit_message(
|
|
|
69
70
|
provider_funcs = {
|
|
70
71
|
"anthropic": call_anthropic_api,
|
|
71
72
|
"cerebras": call_cerebras_api,
|
|
73
|
+
"chutes": call_chutes_api,
|
|
72
74
|
"gemini": call_gemini_api,
|
|
73
75
|
"groq": call_groq_api,
|
|
74
76
|
"lmstudio": call_lmstudio_api,
|
gac/ai_utils.py
CHANGED
gac/init_cli.py
CHANGED
|
@@ -32,8 +32,9 @@ def init() -> None:
|
|
|
32
32
|
click.echo(f"Created $HOME/.gac.env at {GAC_ENV_PATH}.")
|
|
33
33
|
|
|
34
34
|
providers = [
|
|
35
|
-
("Anthropic", "claude-
|
|
35
|
+
("Anthropic", "claude-haiku-4-5"),
|
|
36
36
|
("Cerebras", "qwen-3-coder-480b"),
|
|
37
|
+
("Chutes.ai", "zai-org/GLM-4.6-FP8"),
|
|
37
38
|
("Gemini", "gemini-2.5-flash"),
|
|
38
39
|
("Groq", "meta-llama/llama-4-maverick-17b-128e-instruct"),
|
|
39
40
|
("LM Studio", "gemma3"),
|
gac/providers/__init__.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from .anthropic import call_anthropic_api
|
|
4
4
|
from .cerebras import call_cerebras_api
|
|
5
|
+
from .chutes import call_chutes_api
|
|
5
6
|
from .gemini import call_gemini_api
|
|
6
7
|
from .groq import call_groq_api
|
|
7
8
|
from .lmstudio import call_lmstudio_api
|
|
@@ -15,6 +16,7 @@ from .zai import call_zai_api, call_zai_coding_api
|
|
|
15
16
|
__all__ = [
|
|
16
17
|
"call_anthropic_api",
|
|
17
18
|
"call_cerebras_api",
|
|
19
|
+
"call_chutes_api",
|
|
18
20
|
"call_gemini_api",
|
|
19
21
|
"call_groq_api",
|
|
20
22
|
"call_lmstudio_api",
|
gac/providers/chutes.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""Chutes.ai API provider for gac."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from gac.errors import AIError
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def call_chutes_api(model: str, messages: list[dict], temperature: float, max_tokens: int) -> str:
|
|
11
|
+
"""Call Chutes.ai API directly.
|
|
12
|
+
|
|
13
|
+
Chutes.ai provides an OpenAI-compatible API for serverless, decentralized AI compute.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
model: The model to use (e.g., 'deepseek-ai/DeepSeek-V3-0324')
|
|
17
|
+
messages: List of message dictionaries with 'role' and 'content' keys
|
|
18
|
+
temperature: Controls randomness (0.0-1.0)
|
|
19
|
+
max_tokens: Maximum tokens in the response
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
The generated commit message
|
|
23
|
+
|
|
24
|
+
Raises:
|
|
25
|
+
AIError: If authentication fails, API errors occur, or response is invalid
|
|
26
|
+
"""
|
|
27
|
+
api_key = os.getenv("CHUTES_API_KEY")
|
|
28
|
+
if not api_key:
|
|
29
|
+
raise AIError.authentication_error("CHUTES_API_KEY environment variable not set")
|
|
30
|
+
|
|
31
|
+
base_url = os.getenv("CHUTES_BASE_URL", "https://llm.chutes.ai")
|
|
32
|
+
url = f"{base_url}/v1/chat/completions"
|
|
33
|
+
|
|
34
|
+
headers = {
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
"Authorization": f"Bearer {api_key}",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
data = {
|
|
40
|
+
"model": model,
|
|
41
|
+
"messages": messages,
|
|
42
|
+
"temperature": temperature,
|
|
43
|
+
"max_tokens": max_tokens,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
try:
|
|
47
|
+
response = httpx.post(url, headers=headers, json=data, timeout=120)
|
|
48
|
+
response.raise_for_status()
|
|
49
|
+
response_data = response.json()
|
|
50
|
+
content = response_data["choices"][0]["message"]["content"]
|
|
51
|
+
if content is None:
|
|
52
|
+
raise AIError.model_error("Chutes.ai API returned null content")
|
|
53
|
+
if content == "":
|
|
54
|
+
raise AIError.model_error("Chutes.ai API returned empty content")
|
|
55
|
+
return content
|
|
56
|
+
except httpx.HTTPStatusError as e:
|
|
57
|
+
status_code = e.response.status_code
|
|
58
|
+
error_text = e.response.text
|
|
59
|
+
|
|
60
|
+
if status_code == 429:
|
|
61
|
+
raise AIError.rate_limit_error(f"Chutes.ai API rate limit exceeded: {error_text}") from e
|
|
62
|
+
elif status_code in (502, 503):
|
|
63
|
+
raise AIError.connection_error(f"Chutes.ai API service unavailable: {status_code} - {error_text}") from e
|
|
64
|
+
else:
|
|
65
|
+
raise AIError.model_error(f"Chutes.ai API error: {status_code} - {error_text}") from e
|
|
66
|
+
except httpx.ConnectError as e:
|
|
67
|
+
raise AIError.connection_error(f"Chutes.ai API connection error: {str(e)}") from e
|
|
68
|
+
except httpx.TimeoutException as e:
|
|
69
|
+
raise AIError.timeout_error(f"Chutes.ai API request timed out: {str(e)}") from e
|
|
70
|
+
except Exception as e:
|
|
71
|
+
raise AIError.model_error(f"Error calling Chutes.ai API: {str(e)}") from e
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gac
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
4
4
|
Summary: AI-powered Git commit message generator with multi-provider support
|
|
5
5
|
Project-URL: Homepage, https://github.com/cellwebb/gac
|
|
6
6
|
Project-URL: Documentation, https://github.com/cellwebb/gac#readme
|
|
@@ -58,7 +58,7 @@ Description-Content-Type: text/markdown
|
|
|
58
58
|
|
|
59
59
|
- **LLM-Powered Commit Messages:** Automatically generates clear, concise, and context-aware commit messages using large language models.
|
|
60
60
|
- **Deep Contextual Analysis:** Understands your code by analyzing staged changes, repository structure, and recent commit history to provide highly relevant suggestions.
|
|
61
|
-
- **Multi-Provider & Model Support:** Flexibly works with leading AI providers (Anthropic, Cerebras, Gemini, Groq, OpenAI, OpenRouter, Streamlake/Vanchin, Z.AI) and local providers (LM Studio
|
|
61
|
+
- **Multi-Provider & Model Support:** Flexibly works with leading AI providers (Anthropic, Cerebras, Chutes.ai, Gemini, Groq, OpenAI, OpenRouter, Streamlake/Vanchin, Synthetic.new, & Z.AI) and local providers (LM Studio & Ollama), easily configured through an interactive setup or environment variables.
|
|
62
62
|
- **Seamless Git Workflow:** Integrates smoothly into your existing Git routine as a simple drop-in replacement for `git commit`.
|
|
63
63
|
- **Extensive Customization:** Tailor commit messages to your needs with a rich set of flags, including one-liners (`-o`), AI hints (`-h`), scope inference (`-s`), and specific model selection (`-m`).
|
|
64
64
|
- **Streamlined Workflow Commands:** Boost your productivity with convenient options to stage all changes (`-a`), auto-confirm commits (`-y`), and push to your remote repository (`-p`) in a single step.
|
|
@@ -70,12 +70,6 @@ Description-Content-Type: text/markdown
|
|
|
70
70
|
|
|
71
71
|
gac analyzes your staged changes to generate high-quality commit messages with the help of large language models. The tool uses a sophisticated prompt architecture that separates system instructions from user data, enabling better AI understanding and more consistent results.
|
|
72
72
|
|
|
73
|
-
### Technical Architecture
|
|
74
|
-
|
|
75
|
-
- **Dual-Prompt System**: GAC uses a separated prompt architecture where system instructions (role definition, conventions, examples) are sent as system messages, while git data (diffs, status) are sent as user messages. This follows AI best practices for improved model performance.
|
|
76
|
-
- **Smart Context Analysis**: The tool examines your repository structure, recent commit history, and README files to understand the broader context of your changes.
|
|
77
|
-
- **Intelligent Diff Processing**: Large diffs are automatically preprocessed to focus on the most important changes while staying within token limits.
|
|
78
|
-
|
|
79
73
|
## How to Use
|
|
80
74
|
|
|
81
75
|
```sh
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
gac/__init__.py,sha256=z9yGInqtycFIT3g1ca24r-A3699hKVaRqGUI79wsmMc,415
|
|
2
|
-
gac/__version__.py,sha256=
|
|
3
|
-
gac/ai.py,sha256=
|
|
4
|
-
gac/ai_utils.py,sha256=
|
|
2
|
+
gac/__version__.py,sha256=ZrEUwsZomybTNkOGMfS08i073_U6EUzf2X5DfW6ia3g,66
|
|
3
|
+
gac/ai.py,sha256=T8o7ZenWDB94ILMvt5hp8mp_J6BbMJ3h5Y_0y2kRrX8,3512
|
|
4
|
+
gac/ai_utils.py,sha256=kz_ROoJjFZGPXxiyy225MuvMv9DikiqJBXOqKVlLVlc,7253
|
|
5
5
|
gac/cli.py,sha256=nvJW_FmS0xA8Vs7x-JdIu4mW9Ze7IelYP8bnZYVFB4E,4885
|
|
6
6
|
gac/config.py,sha256=N62phuLUyVj54eLDiDL6VN8-2_Zt6yB5zsnimFavU3I,1630
|
|
7
7
|
gac/config_cli.py,sha256=v9nFHZO1RvK9fzHyuUS6SG-BCLHMsdOMDwWamBhVVh4,1608
|
|
@@ -9,15 +9,16 @@ gac/constants.py,sha256=hGzmLGhVDB2KPIqwtl6tHMNuSwHj-2P1RK0cGm4pyNA,4962
|
|
|
9
9
|
gac/diff_cli.py,sha256=wnVQ9OFGnM0d2Pj9WVjWbo0jxqIuRHVAwmb8wU9Pa3E,5676
|
|
10
10
|
gac/errors.py,sha256=ysDIVRCd0YQVTOW3Q6YzdolxCdtkoQCAFf3_jrqbjUY,7916
|
|
11
11
|
gac/git.py,sha256=_Co25XA1Nku03h50C_HiEf4ugEz6rK5j_IYi-rr5gco,8005
|
|
12
|
-
gac/init_cli.py,sha256=
|
|
12
|
+
gac/init_cli.py,sha256=LEw26g-tb6GZdN3DaUuLx3OFvZPKPOIFKnqgDRe6Y8s,4677
|
|
13
13
|
gac/main.py,sha256=ot1DEbJHsZ0SzdZUuRXIm9pz1xbm4hxARzUjwytGdfc,15670
|
|
14
14
|
gac/preprocess.py,sha256=krrLPHsccYMdn_YAtUrppBJIoRgevxGWusDwhE40LEo,15366
|
|
15
15
|
gac/prompt.py,sha256=K6r9q2cAlyPu1fud6-jJsZ4zeweEo3yt6_WeYv8a_SQ,17087
|
|
16
16
|
gac/security.py,sha256=M1MZm6BLOeKl6rH_-UdXsSKol39FnA5fIP3YP394yZE,9898
|
|
17
17
|
gac/utils.py,sha256=W3ladtmsH01MNLdckQYTzYrYbTGEdzCKI36he9C-y_E,3945
|
|
18
|
-
gac/providers/__init__.py,sha256=
|
|
18
|
+
gac/providers/__init__.py,sha256=ejIM5vvmfTp7vfJSNeQQPIEJusOkKTUZpUE7OeWBc9Y,876
|
|
19
19
|
gac/providers/anthropic.py,sha256=VK5d1s1PmBNDwh_x7illQ2CIZIHNIYU28btVfizwQPs,2036
|
|
20
20
|
gac/providers/cerebras.py,sha256=Ik8lhlsliGJVkgDgqlThfpra9tqbdYQZkaC4eNxRd9w,1648
|
|
21
|
+
gac/providers/chutes.py,sha256=cclJOLuGVIiiaF-9Bs1kH6SSOhEmduGB2zZ86KIaXKw,2617
|
|
21
22
|
gac/providers/gemini.py,sha256=GZQz6Y9fd5-xk-U4pXn9bXLeBowxDXOYDyWyrtjFurM,2909
|
|
22
23
|
gac/providers/groq.py,sha256=9v2fAjDa_iRNHFptiUBN8Vt7ZDKkW_JOmIBeYvycD1M,2806
|
|
23
24
|
gac/providers/lmstudio.py,sha256=R82-f0tWdFfGQxLT6o3Q2tfvYguF7ESUg9DEUHNyrDk,2146
|
|
@@ -27,8 +28,8 @@ gac/providers/openrouter.py,sha256=H3ce8JcRUYq1I30lOjGESdX7jfoPkW3mKAYnc2aYfBw,2
|
|
|
27
28
|
gac/providers/streamlake.py,sha256=KAA2ZnpuEI5imzvdWVWUhEBHSP0BMnprKXte6CbwBWY,2047
|
|
28
29
|
gac/providers/synthetic.py,sha256=sRMIJTS9LpcXd9A7qp_ZjZxdqtTKRn9fl1W4YwJZP4c,1855
|
|
29
30
|
gac/providers/zai.py,sha256=kywhhrCfPBu0rElZyb-iENxQxxpVGykvePuL4xrXlaU,2739
|
|
30
|
-
gac-1.
|
|
31
|
-
gac-1.
|
|
32
|
-
gac-1.
|
|
33
|
-
gac-1.
|
|
34
|
-
gac-1.
|
|
31
|
+
gac-1.8.0.dist-info/METADATA,sha256=4z_AS3NKai5FD1xvY8hYH_lWVGioLT7tpv93y_dhIAY,9245
|
|
32
|
+
gac-1.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
33
|
+
gac-1.8.0.dist-info/entry_points.txt,sha256=tdjN-XMmcWfL92swuRAjT62bFLOAwk9bTMRLGP5Z4aI,36
|
|
34
|
+
gac-1.8.0.dist-info/licenses/LICENSE,sha256=vOab37NouL1PNs5BswnPayrMCqaN2sqLfMQfqPDrpZg,1103
|
|
35
|
+
gac-1.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|