yachay 0.1.0__tar.gz

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.
Files changed (39) hide show
  1. yachay-0.1.0/PKG-INFO +185 -0
  2. yachay-0.1.0/README.md +155 -0
  3. yachay-0.1.0/pyproject.toml +52 -0
  4. yachay-0.1.0/setup.cfg +4 -0
  5. yachay-0.1.0/tests/test_cli_api.py +567 -0
  6. yachay-0.1.0/tests/test_cli_auth.py +228 -0
  7. yachay-0.1.0/tests/test_cli_b2_commands.py +2069 -0
  8. yachay-0.1.0/tests/test_cli_commands.py +757 -0
  9. yachay-0.1.0/tests/test_cli_config.py +180 -0
  10. yachay-0.1.0/tests/test_cli_login_server.py +455 -0
  11. yachay-0.1.0/tests/test_client.py +617 -0
  12. yachay-0.1.0/yachay/__init__.py +39 -0
  13. yachay-0.1.0/yachay/_client.py +206 -0
  14. yachay-0.1.0/yachay/_exceptions.py +92 -0
  15. yachay-0.1.0/yachay/_models.py +120 -0
  16. yachay-0.1.0/yachay/cli/__init__.py +1 -0
  17. yachay-0.1.0/yachay/cli/__main__.py +986 -0
  18. yachay-0.1.0/yachay/cli/api.py +551 -0
  19. yachay-0.1.0/yachay/cli/auth.py +187 -0
  20. yachay-0.1.0/yachay/cli/commands/__init__.py +1 -0
  21. yachay-0.1.0/yachay/cli/commands/account_cmds.py +201 -0
  22. yachay-0.1.0/yachay/cli/commands/auth_cmds.py +538 -0
  23. yachay-0.1.0/yachay/cli/commands/billing_cmds.py +77 -0
  24. yachay-0.1.0/yachay/cli/commands/chat_cmds.py +117 -0
  25. yachay-0.1.0/yachay/cli/commands/dataset_cmds.py +256 -0
  26. yachay-0.1.0/yachay/cli/commands/endpoints_cmds.py +258 -0
  27. yachay-0.1.0/yachay/cli/commands/infer_cmds.py +179 -0
  28. yachay-0.1.0/yachay/cli/commands/job_cmds.py +392 -0
  29. yachay-0.1.0/yachay/cli/commands/jobs_extended_cmds.py +270 -0
  30. yachay-0.1.0/yachay/cli/commands/model_cmds.py +75 -0
  31. yachay-0.1.0/yachay/cli/config.py +163 -0
  32. yachay-0.1.0/yachay/cli/credentials.py +102 -0
  33. yachay-0.1.0/yachay/py.typed +0 -0
  34. yachay-0.1.0/yachay.egg-info/PKG-INFO +185 -0
  35. yachay-0.1.0/yachay.egg-info/SOURCES.txt +37 -0
  36. yachay-0.1.0/yachay.egg-info/dependency_links.txt +1 -0
  37. yachay-0.1.0/yachay.egg-info/entry_points.txt +2 -0
  38. yachay-0.1.0/yachay.egg-info/requires.txt +8 -0
  39. yachay-0.1.0/yachay.egg-info/top_level.txt +1 -0
yachay-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,185 @@
1
+ Metadata-Version: 2.4
2
+ Name: yachay
3
+ Version: 0.1.0
4
+ Summary: Python SDK for Yachay — Condor Models inference API (OpenAI-compatible)
5
+ Author-email: Chicha Technology LLC <hello@chichatechnology.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://yachaymodels.com
8
+ Project-URL: Documentation, https://yachaymodels.com/docs
9
+ Project-URL: Bug Tracker, https://yachaymodels.com/support
10
+ Keywords: yachay,condor,llm,inference,openai,ai
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: httpx>=0.27
24
+ Requires-Dist: typer>=0.12
25
+ Requires-Dist: rich>=13.0
26
+ Requires-Dist: keyring>=24.0
27
+ Requires-Dist: click>=8.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8.0; extra == "dev"
30
+
31
+ # Yachay Python SDK
32
+
33
+ Python client for [Yachay — Condor Models](https://yachaymodels.com) inference API.
34
+ Designed to feel like the OpenAI SDK so migrating existing code takes minutes.
35
+
36
+ ## Install
37
+
38
+ ```bash
39
+ pip install yachay
40
+ ```
41
+
42
+ Requires Python 3.9+.
43
+
44
+ ## Quickstart
45
+
46
+ ```python
47
+ import yachay
48
+
49
+ client = yachay.Client() # reads YACHAY_API_KEY from environment
50
+
51
+ response = client.chat.completions.create(
52
+ model="llama-3.1-8b",
53
+ messages=[{"role": "user", "content": "Explain gradient descent in one paragraph."}],
54
+ )
55
+ print(response.choices[0].message.content)
56
+ ```
57
+
58
+ ## Authentication
59
+
60
+ Create a customer API key in the [Yachay dashboard](https://yachaymodels.com/dashboard/api-access).
61
+ Keys are prefixed `yck_`.
62
+
63
+ **Recommended — environment variable:**
64
+
65
+ ```bash
66
+ export YACHAY_API_KEY="yck_your_key_here"
67
+ ```
68
+
69
+ **Or pass directly:**
70
+
71
+ ```python
72
+ client = yachay.Client(api_key="yck_your_key_here")
73
+ ```
74
+
75
+ ## Available models
76
+
77
+ Two models are currently available for inference:
78
+
79
+ | Model ID | Description |
80
+ |---|---|
81
+ | `llama-3.1-8b` | Meta Llama 3.1 8B — fast general-purpose chat |
82
+ | `deepseek-r1-distill-llama-8b` | DeepSeek R1 distilled into Llama 8B — strong reasoning |
83
+
84
+ To list available models programmatically:
85
+
86
+ ```python
87
+ models = client.models.list()
88
+ for model in models.data:
89
+ print(model.id)
90
+ ```
91
+
92
+ ## Chat completions
93
+
94
+ ```python
95
+ response = client.chat.completions.create(
96
+ model="deepseek-r1-distill-llama-8b",
97
+ messages=[
98
+ {"role": "system", "content": "You are a helpful assistant."},
99
+ {"role": "user", "content": "What is the capital of Peru?"},
100
+ ],
101
+ max_tokens=256,
102
+ temperature=0.7,
103
+ )
104
+
105
+ # Access the generated text
106
+ print(response.choices[0].message.content)
107
+
108
+ # Access token usage
109
+ print(f"Tokens used: {response.usage.total_tokens}")
110
+ ```
111
+
112
+ ## Context manager
113
+
114
+ ```python
115
+ with yachay.Client() as client:
116
+ response = client.chat.completions.create(
117
+ model="llama-3.1-8b",
118
+ messages=[{"role": "user", "content": "Hello!"}],
119
+ )
120
+ print(response.choices[0].message.content)
121
+ # HTTP connection pool is closed automatically
122
+ ```
123
+
124
+ ## Migrating from OpenAI
125
+
126
+ The client mirrors the OpenAI SDK's nested-namespace pattern. Replace:
127
+
128
+ ```python
129
+ # Before
130
+ import openai
131
+ client = openai.OpenAI(api_key="sk-...")
132
+ response = client.chat.completions.create(model="gpt-4o", messages=[...])
133
+ ```
134
+
135
+ with:
136
+
137
+ ```python
138
+ # After
139
+ import yachay
140
+ client = yachay.Client(api_key="yck_...")
141
+ response = client.chat.completions.create(model="llama-3.1-8b", messages=[...])
142
+ ```
143
+
144
+ Response objects share the same shape: `.choices[0].message.content`, `.usage.total_tokens`, etc.
145
+
146
+ ## Error handling
147
+
148
+ ```python
149
+ from yachay import AuthError, RateLimitError, APIError
150
+
151
+ try:
152
+ response = client.chat.completions.create(...)
153
+ except AuthError:
154
+ print("Invalid API key")
155
+ except RateLimitError:
156
+ print("Slow down — you are being rate-limited")
157
+ except APIError as e:
158
+ print(f"API error {e.status}: {e.body}")
159
+ ```
160
+
161
+ All errors are subclasses of `yachay.YachayError`.
162
+
163
+ ## Custom base URL and timeout
164
+
165
+ ```python
166
+ client = yachay.Client(
167
+ api_key="yck_...",
168
+ base_url="https://api.yachaymodels.com/v1", # default; override for testing
169
+ timeout=30.0, # seconds
170
+ )
171
+ ```
172
+
173
+ ## What v1 does NOT include
174
+
175
+ - **Streaming** — `stream=True` is not yet supported. Submit a feature request at [yachaymodels.com/support](https://yachaymodels.com/support).
176
+ - **Fine-tuning job management** — submitting training jobs, downloading adapters, and managing the fine-tuning pipeline are not available through this SDK in v1. Use the [Yachay web dashboard](https://yachaymodels.com/dashboard) for job management.
177
+ - **Embeddings** — not available in v1.
178
+
179
+ ## Documentation
180
+
181
+ Full API reference and guides at [yachaymodels.com/docs](https://yachaymodels.com/docs).
182
+
183
+ ## License
184
+
185
+ MIT — see [LICENSE](../LICENSE) for details.
yachay-0.1.0/README.md ADDED
@@ -0,0 +1,155 @@
1
+ # Yachay Python SDK
2
+
3
+ Python client for [Yachay — Condor Models](https://yachaymodels.com) inference API.
4
+ Designed to feel like the OpenAI SDK so migrating existing code takes minutes.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ pip install yachay
10
+ ```
11
+
12
+ Requires Python 3.9+.
13
+
14
+ ## Quickstart
15
+
16
+ ```python
17
+ import yachay
18
+
19
+ client = yachay.Client() # reads YACHAY_API_KEY from environment
20
+
21
+ response = client.chat.completions.create(
22
+ model="llama-3.1-8b",
23
+ messages=[{"role": "user", "content": "Explain gradient descent in one paragraph."}],
24
+ )
25
+ print(response.choices[0].message.content)
26
+ ```
27
+
28
+ ## Authentication
29
+
30
+ Create a customer API key in the [Yachay dashboard](https://yachaymodels.com/dashboard/api-access).
31
+ Keys are prefixed `yck_`.
32
+
33
+ **Recommended — environment variable:**
34
+
35
+ ```bash
36
+ export YACHAY_API_KEY="yck_your_key_here"
37
+ ```
38
+
39
+ **Or pass directly:**
40
+
41
+ ```python
42
+ client = yachay.Client(api_key="yck_your_key_here")
43
+ ```
44
+
45
+ ## Available models
46
+
47
+ Two models are currently available for inference:
48
+
49
+ | Model ID | Description |
50
+ |---|---|
51
+ | `llama-3.1-8b` | Meta Llama 3.1 8B — fast general-purpose chat |
52
+ | `deepseek-r1-distill-llama-8b` | DeepSeek R1 distilled into Llama 8B — strong reasoning |
53
+
54
+ To list available models programmatically:
55
+
56
+ ```python
57
+ models = client.models.list()
58
+ for model in models.data:
59
+ print(model.id)
60
+ ```
61
+
62
+ ## Chat completions
63
+
64
+ ```python
65
+ response = client.chat.completions.create(
66
+ model="deepseek-r1-distill-llama-8b",
67
+ messages=[
68
+ {"role": "system", "content": "You are a helpful assistant."},
69
+ {"role": "user", "content": "What is the capital of Peru?"},
70
+ ],
71
+ max_tokens=256,
72
+ temperature=0.7,
73
+ )
74
+
75
+ # Access the generated text
76
+ print(response.choices[0].message.content)
77
+
78
+ # Access token usage
79
+ print(f"Tokens used: {response.usage.total_tokens}")
80
+ ```
81
+
82
+ ## Context manager
83
+
84
+ ```python
85
+ with yachay.Client() as client:
86
+ response = client.chat.completions.create(
87
+ model="llama-3.1-8b",
88
+ messages=[{"role": "user", "content": "Hello!"}],
89
+ )
90
+ print(response.choices[0].message.content)
91
+ # HTTP connection pool is closed automatically
92
+ ```
93
+
94
+ ## Migrating from OpenAI
95
+
96
+ The client mirrors the OpenAI SDK's nested-namespace pattern. Replace:
97
+
98
+ ```python
99
+ # Before
100
+ import openai
101
+ client = openai.OpenAI(api_key="sk-...")
102
+ response = client.chat.completions.create(model="gpt-4o", messages=[...])
103
+ ```
104
+
105
+ with:
106
+
107
+ ```python
108
+ # After
109
+ import yachay
110
+ client = yachay.Client(api_key="yck_...")
111
+ response = client.chat.completions.create(model="llama-3.1-8b", messages=[...])
112
+ ```
113
+
114
+ Response objects share the same shape: `.choices[0].message.content`, `.usage.total_tokens`, etc.
115
+
116
+ ## Error handling
117
+
118
+ ```python
119
+ from yachay import AuthError, RateLimitError, APIError
120
+
121
+ try:
122
+ response = client.chat.completions.create(...)
123
+ except AuthError:
124
+ print("Invalid API key")
125
+ except RateLimitError:
126
+ print("Slow down — you are being rate-limited")
127
+ except APIError as e:
128
+ print(f"API error {e.status}: {e.body}")
129
+ ```
130
+
131
+ All errors are subclasses of `yachay.YachayError`.
132
+
133
+ ## Custom base URL and timeout
134
+
135
+ ```python
136
+ client = yachay.Client(
137
+ api_key="yck_...",
138
+ base_url="https://api.yachaymodels.com/v1", # default; override for testing
139
+ timeout=30.0, # seconds
140
+ )
141
+ ```
142
+
143
+ ## What v1 does NOT include
144
+
145
+ - **Streaming** — `stream=True` is not yet supported. Submit a feature request at [yachaymodels.com/support](https://yachaymodels.com/support).
146
+ - **Fine-tuning job management** — submitting training jobs, downloading adapters, and managing the fine-tuning pipeline are not available through this SDK in v1. Use the [Yachay web dashboard](https://yachaymodels.com/dashboard) for job management.
147
+ - **Embeddings** — not available in v1.
148
+
149
+ ## Documentation
150
+
151
+ Full API reference and guides at [yachaymodels.com/docs](https://yachaymodels.com/docs).
152
+
153
+ ## License
154
+
155
+ MIT — see [LICENSE](../LICENSE) for details.
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "yachay"
7
+ version = "0.1.0"
8
+ description = "Python SDK for Yachay — Condor Models inference API (OpenAI-compatible)"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "Chicha Technology LLC", email = "hello@chichatechnology.com" }]
12
+ keywords = ["yachay", "condor", "llm", "inference", "openai", "ai"]
13
+ classifiers = [
14
+ "Development Status :: 3 - Alpha",
15
+ "Intended Audience :: Developers",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.9",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
23
+ "Typing :: Typed",
24
+ ]
25
+ requires-python = ">=3.9"
26
+ dependencies = [
27
+ "httpx>=0.27",
28
+ "typer>=0.12", # MIT — CLI framework
29
+ "rich>=13.0", # MIT — terminal output formatting
30
+ "keyring>=24.0", # MIT — OS keychain for refresh-token storage
31
+ "click>=8.0", # BSD-3 — required by typer
32
+ ]
33
+
34
+ [project.urls]
35
+ Homepage = "https://yachaymodels.com"
36
+ Documentation = "https://yachaymodels.com/docs"
37
+ "Bug Tracker" = "https://yachaymodels.com/support"
38
+
39
+ [project.scripts]
40
+ yachay = "yachay.cli.__main__:main"
41
+
42
+ [project.optional-dependencies]
43
+ dev = [
44
+ "pytest>=8.0",
45
+ ]
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["."]
49
+ include = ["yachay*"]
50
+
51
+ [tool.setuptools.package-data]
52
+ yachay = ["py.typed"]
yachay-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+