coeai 0.1.1__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.
- coeai-0.1.1/LICENSE +21 -0
- coeai-0.1.1/PKG-INFO +308 -0
- coeai-0.1.1/README.md +272 -0
- coeai-0.1.1/coeai/__init__.py +1 -0
- coeai-0.1.1/coeai/infer.py +76 -0
- coeai-0.1.1/coeai.egg-info/PKG-INFO +308 -0
- coeai-0.1.1/coeai.egg-info/SOURCES.txt +10 -0
- coeai-0.1.1/coeai.egg-info/dependency_links.txt +1 -0
- coeai-0.1.1/coeai.egg-info/requires.txt +1 -0
- coeai-0.1.1/coeai.egg-info/top_level.txt +1 -0
- coeai-0.1.1/setup.cfg +4 -0
- coeai-0.1.1/setup.py +34 -0
coeai-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025–2027 Konal Puri
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
coeai-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: coeai
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Client to interact with COE AI-hosted LLM models
|
|
5
|
+
Home-page: https://github.com/pkonal/coeai
|
|
6
|
+
Author: Konal Puri
|
|
7
|
+
Author-email: purikonal23@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: llm inference coeai ollama ai-client
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Requires-Python: >=3.6
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: requests
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: keywords
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
36
|
+
|
|
37
|
+
# coeai `PyPI Package`
|
|
38
|
+
|
|
39
|
+
**Interact with high-capacity multimodal LLMs hosted on the COE AI GPU cluster from any Python environment.**
|
|
40
|
+
|
|
41
|
+
`coeai` is a lightweight Python wrapper currently around the *LLaMA-4 16x17B* model (128K context, vision-enabled) deployed on the Centre of Excellence for AI (COE AI) servers at UPES. It exposes a single `/generate` HTTP endpoint, making it trivial to run both text-only and image+text inference from notebooks, scripts or backend services connected to the UPES Wi-Fi.
|
|
42
|
+
|
|
43
|
+
> **Text and image input** **128,000-token context** **Streaming or batch** **Runs on the COE AI GPU node**
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Table of Contents
|
|
48
|
+
1. [Features](#features)
|
|
49
|
+
2. [Requirements](#requirements)
|
|
50
|
+
3. [Installation](#installation)
|
|
51
|
+
4. [Quick Start](#quick-start)
|
|
52
|
+
5. [API Usage](#api-usage)
|
|
53
|
+
6. [Model Parameters](#model-parameters)
|
|
54
|
+
7. [Authentication](#authentication)
|
|
55
|
+
8. [Joining COE AI](#joining-coe-ai)
|
|
56
|
+
9. [Troubleshooting](#troubleshooting)
|
|
57
|
+
10. [License](#license)
|
|
58
|
+
11. [Author](#author)
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Features
|
|
63
|
+
|
|
64
|
+
* **Ultra-long context** up to **128K tokens** per request for long documents or multi-turn chats
|
|
65
|
+
* **Vision support** send images along with text for multimodal reasoning
|
|
66
|
+
* **High performance** queries are served by a dedicated GPU node inside the COE AI HPC cluster
|
|
67
|
+
* **Simple auth** authenticate with a short-lived API key (valid 30 days) sent in the request header
|
|
68
|
+
* **Drop-in wrapper** minimal Python API; no need to handle HTTP manually
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Requirements
|
|
73
|
+
|
|
74
|
+
* Python **3.8 or newer**
|
|
75
|
+
* Network access to `http://10.16.1.50:8000` from the UPES campus Wi-Fi
|
|
76
|
+
* A **valid API key** issued by the COE AI team
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Installation
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pip install coeai
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This pulls the latest release from PyPI.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Quick Start
|
|
91
|
+
|
|
92
|
+
The wrapper exposes a single `LLMinfer` class. Initialize it with the API URL and your API key, then call `infer()`.
|
|
93
|
+
|
|
94
|
+
### Text-to-Text
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from coeai import LLMinfer
|
|
98
|
+
|
|
99
|
+
llm = LLMinfer(
|
|
100
|
+
api_url="http://10.16.1.50:8000/generate",
|
|
101
|
+
api_key="API_KEY"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
response = llm.infer(
|
|
105
|
+
mode="text-to-text",
|
|
106
|
+
prompt_text="Summarize the key points of general relativity.",
|
|
107
|
+
max_tokens=500,
|
|
108
|
+
temperature=0.6,
|
|
109
|
+
top_p=0.95,
|
|
110
|
+
stream=False
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
print(response)
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Image + Text
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from coeai import LLMinfer
|
|
121
|
+
|
|
122
|
+
# Initialize the client
|
|
123
|
+
llm = LLMinfer(
|
|
124
|
+
api_url="http://10.16.1.50:8000/generate",
|
|
125
|
+
api_key="API_KEY"
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# Run inference with image and prompt
|
|
129
|
+
response = llm.infer(
|
|
130
|
+
mode="image-text-to-text",
|
|
131
|
+
prompt_text="Describe what's happening in the image.",
|
|
132
|
+
image_path="/home/konal.106904/sample.jpg", # <-- update to a valid path
|
|
133
|
+
max_tokens=512,
|
|
134
|
+
temperature=0.7,
|
|
135
|
+
top_p=1.0,
|
|
136
|
+
stream=False
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# Print the response
|
|
140
|
+
print(response)
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## API Usage
|
|
147
|
+
|
|
148
|
+
### Using the Python Wrapper
|
|
149
|
+
|
|
150
|
+
The examples above show the recommended approach using the `LLMinfer` class.
|
|
151
|
+
|
|
152
|
+
### Direct API Access with cURL
|
|
153
|
+
|
|
154
|
+
You can also interact directly with the `/generate` endpoint using cURL.
|
|
155
|
+
|
|
156
|
+
#### Prerequisites
|
|
157
|
+
|
|
158
|
+
| Requirement | Purpose |
|
|
159
|
+
|-------------|---------|
|
|
160
|
+
| A running instance of the API | Default URL: `http://10.16.1.50:8000/generate` |
|
|
161
|
+
| Valid API key | Supply in the `X-API-Key` request header |
|
|
162
|
+
| cURL 7.68+ | Supports `--data @-` JSON piping |
|
|
163
|
+
|
|
164
|
+
#### Text-Only Request
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
curl -X POST http://10.16.1.50:8000/generate \
|
|
168
|
+
-H "Content-Type: application/json" \
|
|
169
|
+
-H "X-API-Key: YOUR_API_KEY_HERE" \
|
|
170
|
+
-d '{
|
|
171
|
+
"model": "llama4",
|
|
172
|
+
"messages": [
|
|
173
|
+
{
|
|
174
|
+
"role": "system",
|
|
175
|
+
"content": "This is a chat between a user and an assistant. The assistant is helping the user with general questions."
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"role": "user",
|
|
179
|
+
"content": "Explain what a black hole is."
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"max_tokens": 512,
|
|
183
|
+
"temperature": 0.7,
|
|
184
|
+
"top_p": 1.0,
|
|
185
|
+
"stream": false
|
|
186
|
+
}'
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
#### Image + Text Request
|
|
190
|
+
|
|
191
|
+
For multimodal requests, include the image as a Base64-encoded Data URI in the `content` array:
|
|
192
|
+
|
|
193
|
+
> **Note:** Replace `YOUR_API_KEY_HERE` with your own API key and `PUT_BASE64_IMAGE_STRING_HERE` with the **Base64-encoded** contents of your image file.
|
|
194
|
+
|
|
195
|
+
**How it Works:**
|
|
196
|
+
1. **Inline Image**: The `image_url` object embeds the entire image as a Data URI so no separate file upload is required
|
|
197
|
+
2. **Multi-Modal Prompt**: The `content` field is an array containing both the image and the accompanying text question, preserving ordering
|
|
198
|
+
3. **Response**: The server returns a JSON object containing the assistant's interpretation of the supplied image
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Model Parameters
|
|
203
|
+
|
|
204
|
+
### Default Parameters
|
|
205
|
+
|
|
206
|
+
| Field | Description | Default |
|
|
207
|
+
|----------------|----------------------------------------------|---------|
|
|
208
|
+
| `model` | Model name (currently fixed to `llama4`) | `llama4` |
|
|
209
|
+
| `stream` | Return tokens incrementally | `false` |
|
|
210
|
+
| `max_tokens` | Maximum new tokens to generate | `1024` |
|
|
211
|
+
| `temperature` | Sampling temperature (creativity) | `0.7` |
|
|
212
|
+
| `top_p` | Nucleus sampling | `1.0` |
|
|
213
|
+
| `stop` | List of stop sequences | `null` |
|
|
214
|
+
|
|
215
|
+
### Parameter Details
|
|
216
|
+
|
|
217
|
+
| Parameter | Description |
|
|
218
|
+
|----------------|-------------|
|
|
219
|
+
| `model` | The model identifier exposed by your server (here `llama4`) |
|
|
220
|
+
| `messages` | Conversation history, each entry containing a `role` and `content` |
|
|
221
|
+
| `max_tokens` | Upper bound on tokens in the assistant reply |
|
|
222
|
+
| `temperature` | Controls randomness; lower values yield more deterministic output |
|
|
223
|
+
| `top_p` | Nucleus sampling; keep at `1.0` for default behavior |
|
|
224
|
+
| `stream` | When `true`, the API will send incremental responses via Server-Sent Events (SSE) |
|
|
225
|
+
|
|
226
|
+
> **Note:** The server enforces total context of 128K tokens (prompt + generated). Adjust `max_tokens` accordingly.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Authentication
|
|
231
|
+
|
|
232
|
+
All requests must include an **API key** issued by the COE AI team. Pass the key when constructing `LLMinfer` (it is added as an `Authorization` header behind the scenes).
|
|
233
|
+
|
|
234
|
+
### Requesting an API Key
|
|
235
|
+
|
|
236
|
+
1. **Join COE AI** see [Joining COE AI](#joining-coe-ai) for membership instructions
|
|
237
|
+
2. After joining, send an email to `hpc-access@ddn.upes.ac.in` *from your official UPES account* using this template:
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
Subject: API Key Request for COE AI LLM Access
|
|
241
|
+
|
|
242
|
+
Dear COE AI Team,
|
|
243
|
+
|
|
244
|
+
I am requesting access to the LLM API for my project work.
|
|
245
|
+
|
|
246
|
+
Project Details:
|
|
247
|
+
- Project Name: <Your Project Name>
|
|
248
|
+
- Project Description: <Brief description>
|
|
249
|
+
- Expected Usage: <How you plan to use the LLM>
|
|
250
|
+
- Duration: <Timeline>
|
|
251
|
+
|
|
252
|
+
Reason for API Access:
|
|
253
|
+
<Research objectives or academic requirements>
|
|
254
|
+
|
|
255
|
+
Additional Information:
|
|
256
|
+
- Name: <Your Name>
|
|
257
|
+
- Email: <Your Email>
|
|
258
|
+
- Department/Affiliation: <Dept/Organisation>
|
|
259
|
+
- Student/Faculty ID: <If applicable>
|
|
260
|
+
|
|
261
|
+
Thank you for considering my request.
|
|
262
|
+
|
|
263
|
+
Best regards,
|
|
264
|
+
<Your Name>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
3. Allow **2-3 business days** for processing. The team will reply with your API key.
|
|
268
|
+
|
|
269
|
+
### Key Renewal
|
|
270
|
+
|
|
271
|
+
Keys expire **after 30 days**. Email the same address with the subject:
|
|
272
|
+
```
|
|
273
|
+
Subject: API Key Renewal Request for COE AI LLM Access
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Include your previous key and a brief usage summary.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Joining COE AI
|
|
281
|
+
|
|
282
|
+
Interested in HPC and AI research? Apply for membership (UPES Wi-Fi only):
|
|
283
|
+
<https://coeai.ddn.upes.ac.in/how-to-join>
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Troubleshooting
|
|
288
|
+
|
|
289
|
+
| Symptom | Possible Cause | Fix |
|
|
290
|
+
|---------|----------------|-----|
|
|
291
|
+
| `ConnectionError` | Not on UPES network | Connect to campus Wi-Fi or VPN |
|
|
292
|
+
| `401 Unauthorized` | Missing/expired API key | Request or renew your key |
|
|
293
|
+
| Long latency | Very large prompts or high `max_tokens` | Reduce prompt size or output length |
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## License
|
|
298
|
+
|
|
299
|
+
`coeai` is released under the **MIT License**.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Author
|
|
304
|
+
|
|
305
|
+
**Konal Puri**
|
|
306
|
+
Centre of Excellence: AI (COE AI), HPC Project, UPES
|
|
307
|
+
|
|
308
|
+
PyPI: <https://pypi.org/project/coeai>
|
coeai-0.1.1/README.md
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# coeai `PyPI Package`
|
|
2
|
+
|
|
3
|
+
**Interact with high-capacity multimodal LLMs hosted on the COE AI GPU cluster from any Python environment.**
|
|
4
|
+
|
|
5
|
+
`coeai` is a lightweight Python wrapper currently around the *LLaMA-4 16x17B* model (128K context, vision-enabled) deployed on the Centre of Excellence for AI (COE AI) servers at UPES. It exposes a single `/generate` HTTP endpoint, making it trivial to run both text-only and image+text inference from notebooks, scripts or backend services connected to the UPES Wi-Fi.
|
|
6
|
+
|
|
7
|
+
> **Text and image input** **128,000-token context** **Streaming or batch** **Runs on the COE AI GPU node**
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Table of Contents
|
|
12
|
+
1. [Features](#features)
|
|
13
|
+
2. [Requirements](#requirements)
|
|
14
|
+
3. [Installation](#installation)
|
|
15
|
+
4. [Quick Start](#quick-start)
|
|
16
|
+
5. [API Usage](#api-usage)
|
|
17
|
+
6. [Model Parameters](#model-parameters)
|
|
18
|
+
7. [Authentication](#authentication)
|
|
19
|
+
8. [Joining COE AI](#joining-coe-ai)
|
|
20
|
+
9. [Troubleshooting](#troubleshooting)
|
|
21
|
+
10. [License](#license)
|
|
22
|
+
11. [Author](#author)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
* **Ultra-long context** up to **128K tokens** per request for long documents or multi-turn chats
|
|
29
|
+
* **Vision support** send images along with text for multimodal reasoning
|
|
30
|
+
* **High performance** queries are served by a dedicated GPU node inside the COE AI HPC cluster
|
|
31
|
+
* **Simple auth** authenticate with a short-lived API key (valid 30 days) sent in the request header
|
|
32
|
+
* **Drop-in wrapper** minimal Python API; no need to handle HTTP manually
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Requirements
|
|
37
|
+
|
|
38
|
+
* Python **3.8 or newer**
|
|
39
|
+
* Network access to `http://10.16.1.50:8000` from the UPES campus Wi-Fi
|
|
40
|
+
* A **valid API key** issued by the COE AI team
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install coeai
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This pulls the latest release from PyPI.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
The wrapper exposes a single `LLMinfer` class. Initialize it with the API URL and your API key, then call `infer()`.
|
|
57
|
+
|
|
58
|
+
### Text-to-Text
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from coeai import LLMinfer
|
|
62
|
+
|
|
63
|
+
llm = LLMinfer(
|
|
64
|
+
api_url="http://10.16.1.50:8000/generate",
|
|
65
|
+
api_key="API_KEY"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
response = llm.infer(
|
|
69
|
+
mode="text-to-text",
|
|
70
|
+
prompt_text="Summarize the key points of general relativity.",
|
|
71
|
+
max_tokens=500,
|
|
72
|
+
temperature=0.6,
|
|
73
|
+
top_p=0.95,
|
|
74
|
+
stream=False
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
print(response)
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Image + Text
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from coeai import LLMinfer
|
|
85
|
+
|
|
86
|
+
# Initialize the client
|
|
87
|
+
llm = LLMinfer(
|
|
88
|
+
api_url="http://10.16.1.50:8000/generate",
|
|
89
|
+
api_key="API_KEY"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Run inference with image and prompt
|
|
93
|
+
response = llm.infer(
|
|
94
|
+
mode="image-text-to-text",
|
|
95
|
+
prompt_text="Describe what's happening in the image.",
|
|
96
|
+
image_path="/home/konal.106904/sample.jpg", # <-- update to a valid path
|
|
97
|
+
max_tokens=512,
|
|
98
|
+
temperature=0.7,
|
|
99
|
+
top_p=1.0,
|
|
100
|
+
stream=False
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
# Print the response
|
|
104
|
+
print(response)
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## API Usage
|
|
111
|
+
|
|
112
|
+
### Using the Python Wrapper
|
|
113
|
+
|
|
114
|
+
The examples above show the recommended approach using the `LLMinfer` class.
|
|
115
|
+
|
|
116
|
+
### Direct API Access with cURL
|
|
117
|
+
|
|
118
|
+
You can also interact directly with the `/generate` endpoint using cURL.
|
|
119
|
+
|
|
120
|
+
#### Prerequisites
|
|
121
|
+
|
|
122
|
+
| Requirement | Purpose |
|
|
123
|
+
|-------------|---------|
|
|
124
|
+
| A running instance of the API | Default URL: `http://10.16.1.50:8000/generate` |
|
|
125
|
+
| Valid API key | Supply in the `X-API-Key` request header |
|
|
126
|
+
| cURL 7.68+ | Supports `--data @-` JSON piping |
|
|
127
|
+
|
|
128
|
+
#### Text-Only Request
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
curl -X POST http://10.16.1.50:8000/generate \
|
|
132
|
+
-H "Content-Type: application/json" \
|
|
133
|
+
-H "X-API-Key: YOUR_API_KEY_HERE" \
|
|
134
|
+
-d '{
|
|
135
|
+
"model": "llama4",
|
|
136
|
+
"messages": [
|
|
137
|
+
{
|
|
138
|
+
"role": "system",
|
|
139
|
+
"content": "This is a chat between a user and an assistant. The assistant is helping the user with general questions."
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"role": "user",
|
|
143
|
+
"content": "Explain what a black hole is."
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"max_tokens": 512,
|
|
147
|
+
"temperature": 0.7,
|
|
148
|
+
"top_p": 1.0,
|
|
149
|
+
"stream": false
|
|
150
|
+
}'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
#### Image + Text Request
|
|
154
|
+
|
|
155
|
+
For multimodal requests, include the image as a Base64-encoded Data URI in the `content` array:
|
|
156
|
+
|
|
157
|
+
> **Note:** Replace `YOUR_API_KEY_HERE` with your own API key and `PUT_BASE64_IMAGE_STRING_HERE` with the **Base64-encoded** contents of your image file.
|
|
158
|
+
|
|
159
|
+
**How it Works:**
|
|
160
|
+
1. **Inline Image**: The `image_url` object embeds the entire image as a Data URI so no separate file upload is required
|
|
161
|
+
2. **Multi-Modal Prompt**: The `content` field is an array containing both the image and the accompanying text question, preserving ordering
|
|
162
|
+
3. **Response**: The server returns a JSON object containing the assistant's interpretation of the supplied image
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Model Parameters
|
|
167
|
+
|
|
168
|
+
### Default Parameters
|
|
169
|
+
|
|
170
|
+
| Field | Description | Default |
|
|
171
|
+
|----------------|----------------------------------------------|---------|
|
|
172
|
+
| `model` | Model name (currently fixed to `llama4`) | `llama4` |
|
|
173
|
+
| `stream` | Return tokens incrementally | `false` |
|
|
174
|
+
| `max_tokens` | Maximum new tokens to generate | `1024` |
|
|
175
|
+
| `temperature` | Sampling temperature (creativity) | `0.7` |
|
|
176
|
+
| `top_p` | Nucleus sampling | `1.0` |
|
|
177
|
+
| `stop` | List of stop sequences | `null` |
|
|
178
|
+
|
|
179
|
+
### Parameter Details
|
|
180
|
+
|
|
181
|
+
| Parameter | Description |
|
|
182
|
+
|----------------|-------------|
|
|
183
|
+
| `model` | The model identifier exposed by your server (here `llama4`) |
|
|
184
|
+
| `messages` | Conversation history, each entry containing a `role` and `content` |
|
|
185
|
+
| `max_tokens` | Upper bound on tokens in the assistant reply |
|
|
186
|
+
| `temperature` | Controls randomness; lower values yield more deterministic output |
|
|
187
|
+
| `top_p` | Nucleus sampling; keep at `1.0` for default behavior |
|
|
188
|
+
| `stream` | When `true`, the API will send incremental responses via Server-Sent Events (SSE) |
|
|
189
|
+
|
|
190
|
+
> **Note:** The server enforces total context of 128K tokens (prompt + generated). Adjust `max_tokens` accordingly.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Authentication
|
|
195
|
+
|
|
196
|
+
All requests must include an **API key** issued by the COE AI team. Pass the key when constructing `LLMinfer` (it is added as an `Authorization` header behind the scenes).
|
|
197
|
+
|
|
198
|
+
### Requesting an API Key
|
|
199
|
+
|
|
200
|
+
1. **Join COE AI** see [Joining COE AI](#joining-coe-ai) for membership instructions
|
|
201
|
+
2. After joining, send an email to `hpc-access@ddn.upes.ac.in` *from your official UPES account* using this template:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
Subject: API Key Request for COE AI LLM Access
|
|
205
|
+
|
|
206
|
+
Dear COE AI Team,
|
|
207
|
+
|
|
208
|
+
I am requesting access to the LLM API for my project work.
|
|
209
|
+
|
|
210
|
+
Project Details:
|
|
211
|
+
- Project Name: <Your Project Name>
|
|
212
|
+
- Project Description: <Brief description>
|
|
213
|
+
- Expected Usage: <How you plan to use the LLM>
|
|
214
|
+
- Duration: <Timeline>
|
|
215
|
+
|
|
216
|
+
Reason for API Access:
|
|
217
|
+
<Research objectives or academic requirements>
|
|
218
|
+
|
|
219
|
+
Additional Information:
|
|
220
|
+
- Name: <Your Name>
|
|
221
|
+
- Email: <Your Email>
|
|
222
|
+
- Department/Affiliation: <Dept/Organisation>
|
|
223
|
+
- Student/Faculty ID: <If applicable>
|
|
224
|
+
|
|
225
|
+
Thank you for considering my request.
|
|
226
|
+
|
|
227
|
+
Best regards,
|
|
228
|
+
<Your Name>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
3. Allow **2-3 business days** for processing. The team will reply with your API key.
|
|
232
|
+
|
|
233
|
+
### Key Renewal
|
|
234
|
+
|
|
235
|
+
Keys expire **after 30 days**. Email the same address with the subject:
|
|
236
|
+
```
|
|
237
|
+
Subject: API Key Renewal Request for COE AI LLM Access
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Include your previous key and a brief usage summary.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Joining COE AI
|
|
245
|
+
|
|
246
|
+
Interested in HPC and AI research? Apply for membership (UPES Wi-Fi only):
|
|
247
|
+
<https://coeai.ddn.upes.ac.in/how-to-join>
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Troubleshooting
|
|
252
|
+
|
|
253
|
+
| Symptom | Possible Cause | Fix |
|
|
254
|
+
|---------|----------------|-----|
|
|
255
|
+
| `ConnectionError` | Not on UPES network | Connect to campus Wi-Fi or VPN |
|
|
256
|
+
| `401 Unauthorized` | Missing/expired API key | Request or renew your key |
|
|
257
|
+
| Long latency | Very large prompts or high `max_tokens` | Reduce prompt size or output length |
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
`coeai` is released under the **MIT License**.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Author
|
|
268
|
+
|
|
269
|
+
**Konal Puri**
|
|
270
|
+
Centre of Excellence: AI (COE AI), HPC Project, UPES
|
|
271
|
+
|
|
272
|
+
PyPI: <https://pypi.org/project/coeai>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .infer import LLMinfer
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
import base64
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
class LLMinfer:
|
|
6
|
+
def __init__(self, api_url="http://localhost:8000/generate", api_key="mysecretkey", model="llama4"):
|
|
7
|
+
self.api_url = api_url
|
|
8
|
+
self.api_key = api_key
|
|
9
|
+
self.model = model
|
|
10
|
+
self.headers = {
|
|
11
|
+
"Content-Type": "application/json",
|
|
12
|
+
"X-API-Key": self.api_key
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
def infer(self, mode, prompt_text, image_path=None, max_tokens=1024, temperature=0.7, top_p=1.0, stream=False):
|
|
16
|
+
if mode == "text-to-text":
|
|
17
|
+
payload = {
|
|
18
|
+
"model": self.model,
|
|
19
|
+
"messages": [
|
|
20
|
+
{
|
|
21
|
+
"role": "system",
|
|
22
|
+
"content": "This is a chat between a user and an assistant. The assistant is helping the user with general questions."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"role": "user",
|
|
26
|
+
"content": prompt_text
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"max_tokens": max_tokens,
|
|
30
|
+
"temperature": temperature,
|
|
31
|
+
"top_p": top_p,
|
|
32
|
+
"stream": stream
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
elif mode == "image-text-to-text":
|
|
36
|
+
if not image_path or not os.path.exists(image_path):
|
|
37
|
+
raise FileNotFoundError("Image path must be provided and valid for image-text-to-text mode.")
|
|
38
|
+
|
|
39
|
+
with open(image_path, "rb") as f:
|
|
40
|
+
base64_image = base64.b64encode(f.read()).decode("utf-8")
|
|
41
|
+
|
|
42
|
+
payload = {
|
|
43
|
+
"model": self.model,
|
|
44
|
+
"messages": [
|
|
45
|
+
{
|
|
46
|
+
"role": "system",
|
|
47
|
+
"content": "This is a chat between a user and an assistant. The assistant is helping the user to describe an image."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"role": "user",
|
|
51
|
+
"content": [
|
|
52
|
+
{
|
|
53
|
+
"type": "image_url",
|
|
54
|
+
"image_url": {
|
|
55
|
+
"url": f"data:image/jpeg;base64,{base64_image}"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "text",
|
|
60
|
+
"text": prompt_text
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"max_tokens": max_tokens,
|
|
66
|
+
"temperature": temperature,
|
|
67
|
+
"top_p": top_p,
|
|
68
|
+
"stream": stream
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
else:
|
|
72
|
+
raise ValueError("Invalid mode. Use 'text-to-text' or 'image-text-to-text'.")
|
|
73
|
+
|
|
74
|
+
response = requests.post(self.api_url, headers=self.headers, json=payload)
|
|
75
|
+
response.raise_for_status()
|
|
76
|
+
return response.json()
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: coeai
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Client to interact with COE AI-hosted LLM models
|
|
5
|
+
Home-page: https://github.com/pkonal/coeai
|
|
6
|
+
Author: Konal Puri
|
|
7
|
+
Author-email: purikonal23@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: llm inference coeai ollama ai-client
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Requires-Python: >=3.6
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: requests
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: keywords
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
36
|
+
|
|
37
|
+
# coeai `PyPI Package`
|
|
38
|
+
|
|
39
|
+
**Interact with high-capacity multimodal LLMs hosted on the COE AI GPU cluster from any Python environment.**
|
|
40
|
+
|
|
41
|
+
`coeai` is a lightweight Python wrapper currently around the *LLaMA-4 16x17B* model (128K context, vision-enabled) deployed on the Centre of Excellence for AI (COE AI) servers at UPES. It exposes a single `/generate` HTTP endpoint, making it trivial to run both text-only and image+text inference from notebooks, scripts or backend services connected to the UPES Wi-Fi.
|
|
42
|
+
|
|
43
|
+
> **Text and image input** **128,000-token context** **Streaming or batch** **Runs on the COE AI GPU node**
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Table of Contents
|
|
48
|
+
1. [Features](#features)
|
|
49
|
+
2. [Requirements](#requirements)
|
|
50
|
+
3. [Installation](#installation)
|
|
51
|
+
4. [Quick Start](#quick-start)
|
|
52
|
+
5. [API Usage](#api-usage)
|
|
53
|
+
6. [Model Parameters](#model-parameters)
|
|
54
|
+
7. [Authentication](#authentication)
|
|
55
|
+
8. [Joining COE AI](#joining-coe-ai)
|
|
56
|
+
9. [Troubleshooting](#troubleshooting)
|
|
57
|
+
10. [License](#license)
|
|
58
|
+
11. [Author](#author)
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Features
|
|
63
|
+
|
|
64
|
+
* **Ultra-long context** up to **128K tokens** per request for long documents or multi-turn chats
|
|
65
|
+
* **Vision support** send images along with text for multimodal reasoning
|
|
66
|
+
* **High performance** queries are served by a dedicated GPU node inside the COE AI HPC cluster
|
|
67
|
+
* **Simple auth** authenticate with a short-lived API key (valid 30 days) sent in the request header
|
|
68
|
+
* **Drop-in wrapper** minimal Python API; no need to handle HTTP manually
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Requirements
|
|
73
|
+
|
|
74
|
+
* Python **3.8 or newer**
|
|
75
|
+
* Network access to `http://10.16.1.50:8000` from the UPES campus Wi-Fi
|
|
76
|
+
* A **valid API key** issued by the COE AI team
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Installation
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pip install coeai
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This pulls the latest release from PyPI.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Quick Start
|
|
91
|
+
|
|
92
|
+
The wrapper exposes a single `LLMinfer` class. Initialize it with the API URL and your API key, then call `infer()`.
|
|
93
|
+
|
|
94
|
+
### Text-to-Text
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from coeai import LLMinfer
|
|
98
|
+
|
|
99
|
+
llm = LLMinfer(
|
|
100
|
+
api_url="http://10.16.1.50:8000/generate",
|
|
101
|
+
api_key="API_KEY"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
response = llm.infer(
|
|
105
|
+
mode="text-to-text",
|
|
106
|
+
prompt_text="Summarize the key points of general relativity.",
|
|
107
|
+
max_tokens=500,
|
|
108
|
+
temperature=0.6,
|
|
109
|
+
top_p=0.95,
|
|
110
|
+
stream=False
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
print(response)
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Image + Text
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from coeai import LLMinfer
|
|
121
|
+
|
|
122
|
+
# Initialize the client
|
|
123
|
+
llm = LLMinfer(
|
|
124
|
+
api_url="http://10.16.1.50:8000/generate",
|
|
125
|
+
api_key="API_KEY"
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# Run inference with image and prompt
|
|
129
|
+
response = llm.infer(
|
|
130
|
+
mode="image-text-to-text",
|
|
131
|
+
prompt_text="Describe what's happening in the image.",
|
|
132
|
+
image_path="/home/konal.106904/sample.jpg", # <-- update to a valid path
|
|
133
|
+
max_tokens=512,
|
|
134
|
+
temperature=0.7,
|
|
135
|
+
top_p=1.0,
|
|
136
|
+
stream=False
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# Print the response
|
|
140
|
+
print(response)
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## API Usage
|
|
147
|
+
|
|
148
|
+
### Using the Python Wrapper
|
|
149
|
+
|
|
150
|
+
The examples above show the recommended approach using the `LLMinfer` class.
|
|
151
|
+
|
|
152
|
+
### Direct API Access with cURL
|
|
153
|
+
|
|
154
|
+
You can also interact directly with the `/generate` endpoint using cURL.
|
|
155
|
+
|
|
156
|
+
#### Prerequisites
|
|
157
|
+
|
|
158
|
+
| Requirement | Purpose |
|
|
159
|
+
|-------------|---------|
|
|
160
|
+
| A running instance of the API | Default URL: `http://10.16.1.50:8000/generate` |
|
|
161
|
+
| Valid API key | Supply in the `X-API-Key` request header |
|
|
162
|
+
| cURL 7.68+ | Supports `--data @-` JSON piping |
|
|
163
|
+
|
|
164
|
+
#### Text-Only Request
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
curl -X POST http://10.16.1.50:8000/generate \
|
|
168
|
+
-H "Content-Type: application/json" \
|
|
169
|
+
-H "X-API-Key: YOUR_API_KEY_HERE" \
|
|
170
|
+
-d '{
|
|
171
|
+
"model": "llama4",
|
|
172
|
+
"messages": [
|
|
173
|
+
{
|
|
174
|
+
"role": "system",
|
|
175
|
+
"content": "This is a chat between a user and an assistant. The assistant is helping the user with general questions."
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"role": "user",
|
|
179
|
+
"content": "Explain what a black hole is."
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"max_tokens": 512,
|
|
183
|
+
"temperature": 0.7,
|
|
184
|
+
"top_p": 1.0,
|
|
185
|
+
"stream": false
|
|
186
|
+
}'
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
#### Image + Text Request
|
|
190
|
+
|
|
191
|
+
For multimodal requests, include the image as a Base64-encoded Data URI in the `content` array:
|
|
192
|
+
|
|
193
|
+
> **Note:** Replace `YOUR_API_KEY_HERE` with your own API key and `PUT_BASE64_IMAGE_STRING_HERE` with the **Base64-encoded** contents of your image file.
|
|
194
|
+
|
|
195
|
+
**How it Works:**
|
|
196
|
+
1. **Inline Image**: The `image_url` object embeds the entire image as a Data URI so no separate file upload is required
|
|
197
|
+
2. **Multi-Modal Prompt**: The `content` field is an array containing both the image and the accompanying text question, preserving ordering
|
|
198
|
+
3. **Response**: The server returns a JSON object containing the assistant's interpretation of the supplied image
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Model Parameters
|
|
203
|
+
|
|
204
|
+
### Default Parameters
|
|
205
|
+
|
|
206
|
+
| Field | Description | Default |
|
|
207
|
+
|----------------|----------------------------------------------|---------|
|
|
208
|
+
| `model` | Model name (currently fixed to `llama4`) | `llama4` |
|
|
209
|
+
| `stream` | Return tokens incrementally | `false` |
|
|
210
|
+
| `max_tokens` | Maximum new tokens to generate | `1024` |
|
|
211
|
+
| `temperature` | Sampling temperature (creativity) | `0.7` |
|
|
212
|
+
| `top_p` | Nucleus sampling | `1.0` |
|
|
213
|
+
| `stop` | List of stop sequences | `null` |
|
|
214
|
+
|
|
215
|
+
### Parameter Details
|
|
216
|
+
|
|
217
|
+
| Parameter | Description |
|
|
218
|
+
|----------------|-------------|
|
|
219
|
+
| `model` | The model identifier exposed by your server (here `llama4`) |
|
|
220
|
+
| `messages` | Conversation history, each entry containing a `role` and `content` |
|
|
221
|
+
| `max_tokens` | Upper bound on tokens in the assistant reply |
|
|
222
|
+
| `temperature` | Controls randomness; lower values yield more deterministic output |
|
|
223
|
+
| `top_p` | Nucleus sampling; keep at `1.0` for default behavior |
|
|
224
|
+
| `stream` | When `true`, the API will send incremental responses via Server-Sent Events (SSE) |
|
|
225
|
+
|
|
226
|
+
> **Note:** The server enforces total context of 128K tokens (prompt + generated). Adjust `max_tokens` accordingly.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Authentication
|
|
231
|
+
|
|
232
|
+
All requests must include an **API key** issued by the COE AI team. Pass the key when constructing `LLMinfer` (it is added as an `Authorization` header behind the scenes).
|
|
233
|
+
|
|
234
|
+
### Requesting an API Key
|
|
235
|
+
|
|
236
|
+
1. **Join COE AI** see [Joining COE AI](#joining-coe-ai) for membership instructions
|
|
237
|
+
2. After joining, send an email to `hpc-access@ddn.upes.ac.in` *from your official UPES account* using this template:
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
Subject: API Key Request for COE AI LLM Access
|
|
241
|
+
|
|
242
|
+
Dear COE AI Team,
|
|
243
|
+
|
|
244
|
+
I am requesting access to the LLM API for my project work.
|
|
245
|
+
|
|
246
|
+
Project Details:
|
|
247
|
+
- Project Name: <Your Project Name>
|
|
248
|
+
- Project Description: <Brief description>
|
|
249
|
+
- Expected Usage: <How you plan to use the LLM>
|
|
250
|
+
- Duration: <Timeline>
|
|
251
|
+
|
|
252
|
+
Reason for API Access:
|
|
253
|
+
<Research objectives or academic requirements>
|
|
254
|
+
|
|
255
|
+
Additional Information:
|
|
256
|
+
- Name: <Your Name>
|
|
257
|
+
- Email: <Your Email>
|
|
258
|
+
- Department/Affiliation: <Dept/Organisation>
|
|
259
|
+
- Student/Faculty ID: <If applicable>
|
|
260
|
+
|
|
261
|
+
Thank you for considering my request.
|
|
262
|
+
|
|
263
|
+
Best regards,
|
|
264
|
+
<Your Name>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
3. Allow **2-3 business days** for processing. The team will reply with your API key.
|
|
268
|
+
|
|
269
|
+
### Key Renewal
|
|
270
|
+
|
|
271
|
+
Keys expire **after 30 days**. Email the same address with the subject:
|
|
272
|
+
```
|
|
273
|
+
Subject: API Key Renewal Request for COE AI LLM Access
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Include your previous key and a brief usage summary.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Joining COE AI
|
|
281
|
+
|
|
282
|
+
Interested in HPC and AI research? Apply for membership (UPES Wi-Fi only):
|
|
283
|
+
<https://coeai.ddn.upes.ac.in/how-to-join>
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Troubleshooting
|
|
288
|
+
|
|
289
|
+
| Symptom | Possible Cause | Fix |
|
|
290
|
+
|---------|----------------|-----|
|
|
291
|
+
| `ConnectionError` | Not on UPES network | Connect to campus Wi-Fi or VPN |
|
|
292
|
+
| `401 Unauthorized` | Missing/expired API key | Request or renew your key |
|
|
293
|
+
| Long latency | Very large prompts or high `max_tokens` | Reduce prompt size or output length |
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## License
|
|
298
|
+
|
|
299
|
+
`coeai` is released under the **MIT License**.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Author
|
|
304
|
+
|
|
305
|
+
**Konal Puri**
|
|
306
|
+
Centre of Excellence: AI (COE AI), HPC Project, UPES
|
|
307
|
+
|
|
308
|
+
PyPI: <https://pypi.org/project/coeai>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
coeai
|
coeai-0.1.1/setup.cfg
ADDED
coeai-0.1.1/setup.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
# Safely read the README content
|
|
5
|
+
this_directory = Path(__file__).parent
|
|
6
|
+
long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
|
7
|
+
|
|
8
|
+
setup(
|
|
9
|
+
name="coeai",
|
|
10
|
+
version="0.1.1", # Bump version before re-upload
|
|
11
|
+
author="Konal Puri",
|
|
12
|
+
author_email="purikonal23@gmail.com",
|
|
13
|
+
description="Client to interact with COE AI-hosted LLM models",
|
|
14
|
+
long_description=long_description,
|
|
15
|
+
long_description_content_type="text/markdown",
|
|
16
|
+
url="https://github.com/pkonal/coeai",
|
|
17
|
+
license="MIT",
|
|
18
|
+
packages=find_packages(),
|
|
19
|
+
install_requires=["requests"],
|
|
20
|
+
python_requires=">=3.6",
|
|
21
|
+
classifiers=[
|
|
22
|
+
"Development Status :: 5 - Production/Stable", # ✅
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
25
|
+
"License :: OSI Approved :: MIT License",
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: Python :: 3.6",
|
|
28
|
+
"Programming Language :: Python :: 3.7",
|
|
29
|
+
"Programming Language :: Python :: 3.8",
|
|
30
|
+
"Programming Language :: Python :: 3.9",
|
|
31
|
+
"Operating System :: OS Independent",
|
|
32
|
+
],
|
|
33
|
+
keywords="llm inference coeai ollama ai-client",
|
|
34
|
+
)
|