ASUllmAPI 0.0.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.
@@ -0,0 +1,2 @@
1
+ from .model_config import ModelConfig
2
+ from .api import query_llm, query_model_info_api, model_provider_mapper, model_list
@@ -0,0 +1,81 @@
1
+ import requests
2
+ import traceback
3
+ from time import sleep
4
+ from .model_config import ModelConfig
5
+
6
+ __author__ = 'swliu'
7
+
8
+
9
+ def query_llm(model: ModelConfig, query, num_retry: int = 3) -> str:
10
+ for i in range(num_retry):
11
+ try:
12
+ payload = _compute_payload(model=model, query=query)
13
+ headers = _compute_headers(model.access_token)
14
+ response = requests.post(model.api_url, json=payload, headers=headers)
15
+ response_text = response.json()['response']
16
+ return response_text
17
+ except Exception as e:
18
+ print(traceback.format_exc())
19
+ sleep(1)
20
+ continue
21
+ return ""
22
+
23
+
24
+ def query_model_info_api(access_token, url, num_retry: int = 3) -> list:
25
+ """
26
+ :param access_token: API access token.
27
+ :param url: API endpoint
28
+ :param num_retry: int
29
+ :return: a list of large language models that are hosted by ASU
30
+ """
31
+ for i in range(num_retry):
32
+ try:
33
+ headers = _compute_headers(access_token=access_token)
34
+ response = requests.get(url=url, headers=headers)
35
+ models_dict = json.loads(response.content)
36
+ models = models_dict["models"]
37
+ return models
38
+ except Exception as e:
39
+ print(traceback.format_exc())
40
+ sleep(1)
41
+ continue
42
+ return []
43
+
44
+
45
+ def model_provider_mapper(models: list) -> dict:
46
+ mapper = {
47
+ model["name"]: model["provider"]
48
+ for model in models
49
+ }
50
+ return mapper
51
+
52
+
53
+ def model_list(models: list) -> set:
54
+ models = {model["name"] for model in models}
55
+ return models
56
+
57
+
58
+ def _compute_headers(access_token):
59
+ headers = {
60
+ "Accept": "application/json",
61
+ "Authorization": f'Bearer {access_token}'
62
+ }
63
+ return headers
64
+
65
+
66
+ def _compute_payload(model: ModelConfig, query: str):
67
+ payload = {
68
+ # required
69
+ "model_provider": model.provider,
70
+ # required
71
+ "model_name": model.name,
72
+ # optional
73
+ "model_params": model.model_params,
74
+ # required
75
+ "prompt": query,
76
+ # optional
77
+ "enable_search": model.enable_search,
78
+ # optional
79
+ "search_params": model.search_params
80
+ }
81
+ return payload
@@ -0,0 +1,68 @@
1
+ from dataclasses import dataclass
2
+
3
+ __author__ = 'swliu'
4
+
5
+
6
+ @dataclass(frozen=True)
7
+ class ModelConfig:
8
+ name: str = ''
9
+ provider: str = ''
10
+ enable_search: bool = True
11
+ api_url: str = ''
12
+ access_token: str = None
13
+ model_temperature: float = None
14
+ model_max_tokens: int = None
15
+ model_top_p = None
16
+ model_top_k = None
17
+ search_collection: str = 'asu'
18
+ search_top_k: int = 3
19
+
20
+ @property
21
+ def model_params(self):
22
+ if not self.access_token:
23
+ raise AccessTokenMissing
24
+ if not self.api_url:
25
+ raise APIUrlMissing
26
+
27
+ model_params = {}
28
+ if self.model_temperature is not None:
29
+ model_params["temperature"] = self.model_temperature
30
+ if self.model_max_tokens is not None:
31
+ model_params["max_tokens"] = self.model_max_tokens
32
+ if self.model_top_p is not None:
33
+ model_params["top_p"] = self.model_top_p
34
+ if self.model_top_k is not None:
35
+ model_params["top_k"] = self.model_top_k
36
+ return model_params
37
+
38
+ @property
39
+ def search_params(self):
40
+ if not self.access_token:
41
+ raise AccessTokenMissing
42
+ if not self.api_url:
43
+ raise APIUrlMissing
44
+
45
+ search_params = {}
46
+ if self.enable_search is True:
47
+ search_params["collection"] = self.search_collection
48
+ search_params["top_k"] = self.search_top_k
49
+ return search_params
50
+
51
+ def __str__(self):
52
+ if self.enable_search:
53
+ return f"{self.name}_search_enabled"
54
+ else:
55
+ return self.name
56
+
57
+ def __repr__(self):
58
+ return f"Model: {self.name}\tSearch Enabled: {str(self.enable_search)}"
59
+
60
+
61
+ class AccessTokenMissing(Exception):
62
+ def __init__(self):
63
+ self.message = "API access token is missing."
64
+
65
+
66
+ class APIUrlMissing(Exception):
67
+ def __init__(self):
68
+ self.message = "API url token is missing."
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.1
2
+ Name: ASUllmAPI
3
+ Version: 0.0.1
4
+ Summary: A simple python package to facilitate connection to ASU LLM API
5
+ Author-email: Stella Wenxing Liu <stellawenxingliu@gmail.com>
6
+ Project-URL: Homepage, https://github.com/ASU/aiml-ssmdv-student-support-ml-data-visualization
7
+ Project-URL: Issues, https://github.com/ASU/aiml-ssmdv-student-support-ml-data-visualization/issues
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+
15
+ # Models
16
+
17
+ ### Model Params
18
+ ```markdown
19
+ "model_params": {
20
+ "temperature": float,
21
+ "max_tokens": int,
22
+ "top_p": float,
23
+ "top_k": int,
24
+ },
25
+ "enable_search": bool,
26
+ "search_params": {
27
+ "collection": "asu",
28
+ "top_k": int,
29
+ }
30
+ ```
31
+ #### temperature
32
+ Randomness and Diversity parameter. Use a lower value to decrease randomness in the response.
33
+ #### top_p
34
+ Randomness and Diversity parameter. Use a lower value to ignore less probable options.
35
+ #### top_k
36
+ Randomness and Diversity parameter. The number of token choices the model uses to generate the next token.
37
+ #### max_tokens
38
+ The maximum number of tokens in the generated response.
39
+
40
+ ## Provider: AES
41
+ Checkout [Amazon Bedrock User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids-arns.html) for base model ids and versions.
42
+
43
+ ### Titan Text Models
44
+
45
+ Model IDs:
46
+ - titang1lite
47
+ - titang1express
48
+
49
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-text.html):
50
+
51
+ | Category | Parameter | Key | Minimum | Maximum | Default |
52
+ |--------------------------|-------------|-------------|---------|---------|---------|
53
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
54
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 1 |
55
+ | Length | max_tokens | max_tokens | 0 | 8000 | 512 |
56
+
57
+
58
+ ### Anthropic Claude models
59
+
60
+ Model IDs:
61
+ - claude2_1
62
+ - claude2
63
+ - claude1_3
64
+ - claudeinstant
65
+
66
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html):
67
+
68
+ | Category | Parameter | Key | Minimum | Maximum | Default |
69
+ |--------------------------|-------------|-------------|---------|---------|---------|
70
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
71
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.5 |
72
+ | Randomness and diversity | Top K | top_k | 0 | 500 | 250 |
73
+ | Length | max_tokens | max_tokens | 0 | 4096 | 200 |
74
+
75
+ ### AI21 Labs Jurassic-2 models
76
+
77
+ Model IDs:
78
+ - j2ultra
79
+ - j2mid
80
+
81
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-jurassic2.html)
82
+
83
+ | Category | Parameter | Key | Minimum | Maximum | Default |
84
+ |--------------------------|-------------|-------------|---------|---------|---------|
85
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
86
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.5 |
87
+ | Length | max_tokens | max_tokens | 0 | 8191 | 200 |
88
+
89
+ ### Cohere Command Models
90
+
91
+ Model IDs:
92
+ - command
93
+ - commandlight
94
+
95
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-cohere-command.html)
96
+
97
+ | Category | Parameter | Key | Minimum | Maximum | Default |
98
+ |--------------------------|-------------|-------------|---------|---------|---------|
99
+ | Randomness and diversity | Temperature | temperature | 0 | 5 | 0.9 |
100
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.75 |
101
+ | Randomness and diversity | Top K | top_k | 0 | 500 | 0 |
102
+ | Length | max_tokens | max_tokens | 1 | 4096 | 20 |
103
+
104
+ ### Meta Llama2 Models
105
+
106
+ Model IDs:
107
+ - llama2-13b
108
+
109
+ [Model Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-meta.html)
110
+
111
+ | Category | Parameter | Key | Minimum | Maximum | Default |
112
+ |--------------------------|-------------|-------------|---------|---------|---------|
113
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
114
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.9 |
115
+ | Length | max_tokens | max_tokens | 1 | 2048 | 512 |
116
+
117
+
118
+ ## Provider: Azure
119
+
120
+ [Model Documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability)
121
+
122
+ | Model name | Model ID | Max Request (tokens) |
123
+ |------------|------------------|----------------------|
124
+ | gpt3_5 | gpt-35-turbo | 4096 |
125
+ | gpt3_5-16k | gpt-35-turbo-16k | 16384 |
126
+ | gpt4 | gpt-4 | 8192 |
127
+ | gpt4-32k | gpt-4-32k | 32768 |
128
+
129
+ ## Provider: GCP
130
+
131
+ [Model Documentation](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models)
132
+
133
+ | Model name | Model ID | Max Input Tokens | Max Output Tokens |
134
+ |---------------------|----------------|----------------------|-------------------|
135
+ | PaLM 2 for Chat | chat-bison | 8192 | 1024 |
136
+ | PaLM 2 for Chat 32k | chat-bison-32k | 32768 (input+output) | 8192 |
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ ASUllmAPI/__init__.py
5
+ ASUllmAPI/api.py
6
+ ASUllmAPI/model_config.py
7
+ ASUllmAPI.egg-info/PKG-INFO
8
+ ASUllmAPI.egg-info/SOURCES.txt
9
+ ASUllmAPI.egg-info/dependency_links.txt
10
+ ASUllmAPI.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ ASUllmAPI
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 AI Acceleration Team at Arizona State University
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.
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.1
2
+ Name: ASUllmAPI
3
+ Version: 0.0.1
4
+ Summary: A simple python package to facilitate connection to ASU LLM API
5
+ Author-email: Stella Wenxing Liu <stellawenxingliu@gmail.com>
6
+ Project-URL: Homepage, https://github.com/ASU/aiml-ssmdv-student-support-ml-data-visualization
7
+ Project-URL: Issues, https://github.com/ASU/aiml-ssmdv-student-support-ml-data-visualization/issues
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+
15
+ # Models
16
+
17
+ ### Model Params
18
+ ```markdown
19
+ "model_params": {
20
+ "temperature": float,
21
+ "max_tokens": int,
22
+ "top_p": float,
23
+ "top_k": int,
24
+ },
25
+ "enable_search": bool,
26
+ "search_params": {
27
+ "collection": "asu",
28
+ "top_k": int,
29
+ }
30
+ ```
31
+ #### temperature
32
+ Randomness and Diversity parameter. Use a lower value to decrease randomness in the response.
33
+ #### top_p
34
+ Randomness and Diversity parameter. Use a lower value to ignore less probable options.
35
+ #### top_k
36
+ Randomness and Diversity parameter. The number of token choices the model uses to generate the next token.
37
+ #### max_tokens
38
+ The maximum number of tokens in the generated response.
39
+
40
+ ## Provider: AES
41
+ Checkout [Amazon Bedrock User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids-arns.html) for base model ids and versions.
42
+
43
+ ### Titan Text Models
44
+
45
+ Model IDs:
46
+ - titang1lite
47
+ - titang1express
48
+
49
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-text.html):
50
+
51
+ | Category | Parameter | Key | Minimum | Maximum | Default |
52
+ |--------------------------|-------------|-------------|---------|---------|---------|
53
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
54
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 1 |
55
+ | Length | max_tokens | max_tokens | 0 | 8000 | 512 |
56
+
57
+
58
+ ### Anthropic Claude models
59
+
60
+ Model IDs:
61
+ - claude2_1
62
+ - claude2
63
+ - claude1_3
64
+ - claudeinstant
65
+
66
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html):
67
+
68
+ | Category | Parameter | Key | Minimum | Maximum | Default |
69
+ |--------------------------|-------------|-------------|---------|---------|---------|
70
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
71
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.5 |
72
+ | Randomness and diversity | Top K | top_k | 0 | 500 | 250 |
73
+ | Length | max_tokens | max_tokens | 0 | 4096 | 200 |
74
+
75
+ ### AI21 Labs Jurassic-2 models
76
+
77
+ Model IDs:
78
+ - j2ultra
79
+ - j2mid
80
+
81
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-jurassic2.html)
82
+
83
+ | Category | Parameter | Key | Minimum | Maximum | Default |
84
+ |--------------------------|-------------|-------------|---------|---------|---------|
85
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
86
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.5 |
87
+ | Length | max_tokens | max_tokens | 0 | 8191 | 200 |
88
+
89
+ ### Cohere Command Models
90
+
91
+ Model IDs:
92
+ - command
93
+ - commandlight
94
+
95
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-cohere-command.html)
96
+
97
+ | Category | Parameter | Key | Minimum | Maximum | Default |
98
+ |--------------------------|-------------|-------------|---------|---------|---------|
99
+ | Randomness and diversity | Temperature | temperature | 0 | 5 | 0.9 |
100
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.75 |
101
+ | Randomness and diversity | Top K | top_k | 0 | 500 | 0 |
102
+ | Length | max_tokens | max_tokens | 1 | 4096 | 20 |
103
+
104
+ ### Meta Llama2 Models
105
+
106
+ Model IDs:
107
+ - llama2-13b
108
+
109
+ [Model Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-meta.html)
110
+
111
+ | Category | Parameter | Key | Minimum | Maximum | Default |
112
+ |--------------------------|-------------|-------------|---------|---------|---------|
113
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
114
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.9 |
115
+ | Length | max_tokens | max_tokens | 1 | 2048 | 512 |
116
+
117
+
118
+ ## Provider: Azure
119
+
120
+ [Model Documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability)
121
+
122
+ | Model name | Model ID | Max Request (tokens) |
123
+ |------------|------------------|----------------------|
124
+ | gpt3_5 | gpt-35-turbo | 4096 |
125
+ | gpt3_5-16k | gpt-35-turbo-16k | 16384 |
126
+ | gpt4 | gpt-4 | 8192 |
127
+ | gpt4-32k | gpt-4-32k | 32768 |
128
+
129
+ ## Provider: GCP
130
+
131
+ [Model Documentation](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models)
132
+
133
+ | Model name | Model ID | Max Input Tokens | Max Output Tokens |
134
+ |---------------------|----------------|----------------------|-------------------|
135
+ | PaLM 2 for Chat | chat-bison | 8192 | 1024 |
136
+ | PaLM 2 for Chat 32k | chat-bison-32k | 32768 (input+output) | 8192 |
@@ -0,0 +1,122 @@
1
+ # Models
2
+
3
+ ### Model Params
4
+ ```markdown
5
+ "model_params": {
6
+ "temperature": float,
7
+ "max_tokens": int,
8
+ "top_p": float,
9
+ "top_k": int,
10
+ },
11
+ "enable_search": bool,
12
+ "search_params": {
13
+ "collection": "asu",
14
+ "top_k": int,
15
+ }
16
+ ```
17
+ #### temperature
18
+ Randomness and Diversity parameter. Use a lower value to decrease randomness in the response.
19
+ #### top_p
20
+ Randomness and Diversity parameter. Use a lower value to ignore less probable options.
21
+ #### top_k
22
+ Randomness and Diversity parameter. The number of token choices the model uses to generate the next token.
23
+ #### max_tokens
24
+ The maximum number of tokens in the generated response.
25
+
26
+ ## Provider: AES
27
+ Checkout [Amazon Bedrock User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids-arns.html) for base model ids and versions.
28
+
29
+ ### Titan Text Models
30
+
31
+ Model IDs:
32
+ - titang1lite
33
+ - titang1express
34
+
35
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-text.html):
36
+
37
+ | Category | Parameter | Key | Minimum | Maximum | Default |
38
+ |--------------------------|-------------|-------------|---------|---------|---------|
39
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
40
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 1 |
41
+ | Length | max_tokens | max_tokens | 0 | 8000 | 512 |
42
+
43
+
44
+ ### Anthropic Claude models
45
+
46
+ Model IDs:
47
+ - claude2_1
48
+ - claude2
49
+ - claude1_3
50
+ - claudeinstant
51
+
52
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html):
53
+
54
+ | Category | Parameter | Key | Minimum | Maximum | Default |
55
+ |--------------------------|-------------|-------------|---------|---------|---------|
56
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
57
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.5 |
58
+ | Randomness and diversity | Top K | top_k | 0 | 500 | 250 |
59
+ | Length | max_tokens | max_tokens | 0 | 4096 | 200 |
60
+
61
+ ### AI21 Labs Jurassic-2 models
62
+
63
+ Model IDs:
64
+ - j2ultra
65
+ - j2mid
66
+
67
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-jurassic2.html)
68
+
69
+ | Category | Parameter | Key | Minimum | Maximum | Default |
70
+ |--------------------------|-------------|-------------|---------|---------|---------|
71
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
72
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.5 |
73
+ | Length | max_tokens | max_tokens | 0 | 8191 | 200 |
74
+
75
+ ### Cohere Command Models
76
+
77
+ Model IDs:
78
+ - command
79
+ - commandlight
80
+
81
+ [Model documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-cohere-command.html)
82
+
83
+ | Category | Parameter | Key | Minimum | Maximum | Default |
84
+ |--------------------------|-------------|-------------|---------|---------|---------|
85
+ | Randomness and diversity | Temperature | temperature | 0 | 5 | 0.9 |
86
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.75 |
87
+ | Randomness and diversity | Top K | top_k | 0 | 500 | 0 |
88
+ | Length | max_tokens | max_tokens | 1 | 4096 | 20 |
89
+
90
+ ### Meta Llama2 Models
91
+
92
+ Model IDs:
93
+ - llama2-13b
94
+
95
+ [Model Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-meta.html)
96
+
97
+ | Category | Parameter | Key | Minimum | Maximum | Default |
98
+ |--------------------------|-------------|-------------|---------|---------|---------|
99
+ | Randomness and diversity | Temperature | temperature | 0 | 1 | 0.5 |
100
+ | Randomness and diversity | Top P | top_p | 0 | 1 | 0.9 |
101
+ | Length | max_tokens | max_tokens | 1 | 2048 | 512 |
102
+
103
+
104
+ ## Provider: Azure
105
+
106
+ [Model Documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability)
107
+
108
+ | Model name | Model ID | Max Request (tokens) |
109
+ |------------|------------------|----------------------|
110
+ | gpt3_5 | gpt-35-turbo | 4096 |
111
+ | gpt3_5-16k | gpt-35-turbo-16k | 16384 |
112
+ | gpt4 | gpt-4 | 8192 |
113
+ | gpt4-32k | gpt-4-32k | 32768 |
114
+
115
+ ## Provider: GCP
116
+
117
+ [Model Documentation](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models)
118
+
119
+ | Model name | Model ID | Max Input Tokens | Max Output Tokens |
120
+ |---------------------|----------------|----------------------|-------------------|
121
+ | PaLM 2 for Chat | chat-bison | 8192 | 1024 |
122
+ | PaLM 2 for Chat 32k | chat-bison-32k | 32768 (input+output) | 8192 |
@@ -0,0 +1,18 @@
1
+ [project]
2
+ name = "ASUllmAPI"
3
+ version = "0.0.1"
4
+ authors = [
5
+ { name="Stella Wenxing Liu", email="stellawenxingliu@gmail.com" },
6
+ ]
7
+ description = "A simple python package to facilitate connection to ASU LLM API"
8
+ readme = "README.md"
9
+ requires-python = ">=3.8"
10
+ classifiers = [
11
+ "Programming Language :: Python :: 3",
12
+ "License :: OSI Approved :: MIT License",
13
+ "Operating System :: OS Independent",
14
+ ]
15
+
16
+ [project.urls]
17
+ Homepage = "https://github.com/ASU/aiml-ssmdv-student-support-ml-data-visualization"
18
+ Issues = "https://github.com/ASU/aiml-ssmdv-student-support-ml-data-visualization/issues"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+