gllm-inference-binary 0.5.44__cp313-cp313-win_amd64.whl → 0.5.46__cp313-cp313-win_amd64.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 gllm-inference-binary might be problematic. Click here for more details.
- gllm_inference/builder/build_lm_invoker.pyi +60 -1
- gllm_inference/lm_invoker/__init__.pyi +2 -1
- gllm_inference/lm_invoker/portkey_lm_invoker.pyi +260 -0
- gllm_inference/lm_invoker/schema/portkey.pyi +31 -0
- gllm_inference/prompt_builder/format_strategy/__init__.pyi +4 -0
- gllm_inference/prompt_builder/format_strategy/format_strategy.pyi +55 -0
- gllm_inference/prompt_builder/format_strategy/jinja_format_strategy.pyi +45 -0
- gllm_inference/prompt_builder/format_strategy/string_format_strategy.pyi +20 -0
- gllm_inference/prompt_builder/prompt_builder.pyi +19 -6
- gllm_inference/schema/__init__.pyi +2 -2
- gllm_inference/schema/enums.pyi +5 -0
- gllm_inference/schema/model_id.pyi +1 -0
- gllm_inference.cp313-win_amd64.pyd +0 -0
- gllm_inference.pyi +8 -1
- {gllm_inference_binary-0.5.44.dist-info → gllm_inference_binary-0.5.46.dist-info}/METADATA +5 -3
- {gllm_inference_binary-0.5.44.dist-info → gllm_inference_binary-0.5.46.dist-info}/RECORD +18 -12
- {gllm_inference_binary-0.5.44.dist-info → gllm_inference_binary-0.5.46.dist-info}/WHEEL +0 -0
- {gllm_inference_binary-0.5.44.dist-info → gllm_inference_binary-0.5.46.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
|
-
from gllm_inference.lm_invoker import AnthropicLMInvoker as AnthropicLMInvoker, AzureOpenAILMInvoker as AzureOpenAILMInvoker, BedrockLMInvoker as BedrockLMInvoker, DatasaurLMInvoker as DatasaurLMInvoker, GoogleLMInvoker as GoogleLMInvoker, LangChainLMInvoker as LangChainLMInvoker, LiteLLMLMInvoker as LiteLLMLMInvoker, OpenAIChatCompletionsLMInvoker as OpenAIChatCompletionsLMInvoker, OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker, OpenAILMInvoker as OpenAILMInvoker, XAILMInvoker as XAILMInvoker
|
|
2
|
+
from gllm_inference.lm_invoker import AnthropicLMInvoker as AnthropicLMInvoker, AzureOpenAILMInvoker as AzureOpenAILMInvoker, BedrockLMInvoker as BedrockLMInvoker, DatasaurLMInvoker as DatasaurLMInvoker, GoogleLMInvoker as GoogleLMInvoker, LangChainLMInvoker as LangChainLMInvoker, LiteLLMLMInvoker as LiteLLMLMInvoker, OpenAIChatCompletionsLMInvoker as OpenAIChatCompletionsLMInvoker, OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker, OpenAILMInvoker as OpenAILMInvoker, PortkeyLMInvoker as PortkeyLMInvoker, XAILMInvoker as XAILMInvoker
|
|
3
3
|
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
|
|
4
4
|
from gllm_inference.schema.model_id import ModelId as ModelId, ModelProvider as ModelProvider
|
|
5
5
|
from typing import Any
|
|
@@ -14,11 +14,15 @@ class Key:
|
|
|
14
14
|
AZURE_DEPLOYMENT: str
|
|
15
15
|
AZURE_ENDPOINT: str
|
|
16
16
|
BASE_URL: str
|
|
17
|
+
CONFIG: str
|
|
18
|
+
CUSTOM_HOST: str
|
|
17
19
|
CREDENTIALS_PATH: str
|
|
18
20
|
MODEL_ID: str
|
|
19
21
|
MODEL_KWARGS: str
|
|
20
22
|
MODEL_NAME: str
|
|
21
23
|
MODEL_CLASS_PATH: str
|
|
24
|
+
PORTKEY_API_KEY: str
|
|
25
|
+
PROVIDER: str
|
|
22
26
|
SECRET_ACCESS_KEY: str
|
|
23
27
|
|
|
24
28
|
def build_lm_invoker(model_id: str | ModelId, credentials: str | dict[str, Any] | None = None, config: dict[str, Any] | None = None) -> BaseLMInvoker:
|
|
@@ -157,6 +161,61 @@ def build_lm_invoker(model_id: str | ModelId, credentials: str | dict[str, Any]
|
|
|
157
161
|
For the list of supported providers, please refer to the following page:
|
|
158
162
|
https://docs.litellm.ai/docs/providers/
|
|
159
163
|
|
|
164
|
+
# Using Portkey
|
|
165
|
+
Portkey supports multiple authentication methods with strict precedence order.
|
|
166
|
+
Authentication methods are mutually exclusive and cannot be combined.
|
|
167
|
+
|
|
168
|
+
## Config ID Authentication (Highest Precedence)
|
|
169
|
+
```python
|
|
170
|
+
lm_invoker = build_lm_invoker(
|
|
171
|
+
model_id="portkey/any-model",
|
|
172
|
+
credentials="portkey-api-key",
|
|
173
|
+
config={"config": "pc-openai-4f6905"}
|
|
174
|
+
)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Model Catalog Authentication (Combined Format)
|
|
178
|
+
```python
|
|
179
|
+
lm_invoker = build_lm_invoker(
|
|
180
|
+
model_id="portkey/@openai-custom/gpt-4o",
|
|
181
|
+
credentials="portkey-api-key"
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Model Catalog Authentication (Separate Parameters)
|
|
186
|
+
```python
|
|
187
|
+
lm_invoker = build_lm_invoker(
|
|
188
|
+
model_id="portkey/gpt-4o",
|
|
189
|
+
credentials="portkey-api-key",
|
|
190
|
+
config={"provider": "@openai-custom"}
|
|
191
|
+
)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Direct Provider Authentication
|
|
195
|
+
```python
|
|
196
|
+
lm_invoker = build_lm_invoker(
|
|
197
|
+
model_id="portkey/gpt-4o",
|
|
198
|
+
credentials={
|
|
199
|
+
"portkey_api_key": "portkey-api-key",
|
|
200
|
+
"api_key": "sk-...", # Provider\'s API key
|
|
201
|
+
"provider": "openai" # Direct provider (no \'@\' prefix)
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Custom Host Override
|
|
207
|
+
```python
|
|
208
|
+
lm_invoker = build_lm_invoker(
|
|
209
|
+
model_id="portkey/@custom-provider/gpt-4o",
|
|
210
|
+
credentials="portkey-api-key",
|
|
211
|
+
config={"custom_host": "https://your-custom-endpoint.com"}
|
|
212
|
+
)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The Portkey API key can also be provided through the `PORTKEY_API_KEY` environment variable.
|
|
216
|
+
For more details on authentication methods, please refer to:
|
|
217
|
+
https://portkey.ai/docs/product/ai-gateway/universal-api
|
|
218
|
+
|
|
160
219
|
# Using xAI
|
|
161
220
|
```python
|
|
162
221
|
lm_invoker = build_lm_invoker(
|
|
@@ -8,6 +8,7 @@ from gllm_inference.lm_invoker.litellm_lm_invoker import LiteLLMLMInvoker as Lit
|
|
|
8
8
|
from gllm_inference.lm_invoker.openai_chat_completions_lm_invoker import OpenAIChatCompletionsLMInvoker as OpenAIChatCompletionsLMInvoker
|
|
9
9
|
from gllm_inference.lm_invoker.openai_compatible_lm_invoker import OpenAICompatibleLMInvoker as OpenAICompatibleLMInvoker
|
|
10
10
|
from gllm_inference.lm_invoker.openai_lm_invoker import OpenAILMInvoker as OpenAILMInvoker
|
|
11
|
+
from gllm_inference.lm_invoker.portkey_lm_invoker import PortkeyLMInvoker as PortkeyLMInvoker
|
|
11
12
|
from gllm_inference.lm_invoker.xai_lm_invoker import XAILMInvoker as XAILMInvoker
|
|
12
13
|
|
|
13
|
-
__all__ = ['AnthropicLMInvoker', 'AzureOpenAILMInvoker', 'BedrockLMInvoker', 'DatasaurLMInvoker', 'GoogleLMInvoker', 'LangChainLMInvoker', 'LiteLLMLMInvoker', 'OpenAIChatCompletionsLMInvoker', 'OpenAICompatibleLMInvoker', 'OpenAILMInvoker', 'XAILMInvoker']
|
|
14
|
+
__all__ = ['AnthropicLMInvoker', 'AzureOpenAILMInvoker', 'BedrockLMInvoker', 'DatasaurLMInvoker', 'GoogleLMInvoker', 'LangChainLMInvoker', 'LiteLLMLMInvoker', 'OpenAIChatCompletionsLMInvoker', 'OpenAICompatibleLMInvoker', 'OpenAILMInvoker', 'PortkeyLMInvoker', 'XAILMInvoker']
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from gllm_core.event import EventEmitter as EventEmitter
|
|
3
|
+
from gllm_core.schema.tool import Tool as Tool
|
|
4
|
+
from gllm_core.utils.retry import RetryConfig as RetryConfig
|
|
5
|
+
from gllm_inference.constants import SECONDS_TO_MILLISECONDS as SECONDS_TO_MILLISECONDS
|
|
6
|
+
from gllm_inference.lm_invoker.openai_chat_completions_lm_invoker import OpenAIChatCompletionsLMInvoker as OpenAIChatCompletionsLMInvoker
|
|
7
|
+
from gllm_inference.lm_invoker.schema.portkey import InputType as InputType, Key as Key
|
|
8
|
+
from gllm_inference.schema import AttachmentType as AttachmentType, LMOutput as LMOutput, ModelId as ModelId, ModelProvider as ModelProvider, ResponseSchema as ResponseSchema
|
|
9
|
+
from langchain_core.tools import Tool as LangChainTool
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
MIN_THINKING_BUDGET: int
|
|
13
|
+
SUPPORTED_ATTACHMENTS: Incomplete
|
|
14
|
+
VALID_AUTH_METHODS: str
|
|
15
|
+
logger: Incomplete
|
|
16
|
+
|
|
17
|
+
class PortkeyLMInvoker(OpenAIChatCompletionsLMInvoker):
|
|
18
|
+
'''A language model invoker to interact with Portkey\'s Universal API.
|
|
19
|
+
|
|
20
|
+
This class provides support for Portkey’s Universal AI Gateway, which enables unified access to
|
|
21
|
+
multiple providers (e.g., OpenAI, Anthropic, Google, Cohere, Bedrock) via a single API key.
|
|
22
|
+
The `PortkeyLMInvoker` is compatible with all Portkey model routing configurations, including
|
|
23
|
+
model catalog entries, direct providers, and pre-defined configs.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
model_id (str): The model ID of the language model.
|
|
27
|
+
model_provider (str): The provider of the language model.
|
|
28
|
+
model_name (str): The catalog name of the language model.
|
|
29
|
+
client_kwargs (dict[str, Any]): The keyword arguments for the Portkey client.
|
|
30
|
+
default_hyperparameters (dict[str, Any]): Default hyperparameters for invoking the model.
|
|
31
|
+
tools (list[Tool]): The list of tools provided to the model to enable tool calling.
|
|
32
|
+
response_schema (ResponseSchema | None): The schema of the response. If provided, the model will output a
|
|
33
|
+
structured response as defined by the schema. Supports both Pydantic BaseModel and JSON schema dictionary.
|
|
34
|
+
output_analytics (bool): Whether to output the invocation analytics.
|
|
35
|
+
retry_config (RetryConfig): The retry configuration for the language model.
|
|
36
|
+
thinking (bool): Whether to enable thinking mode for supported models.
|
|
37
|
+
thinking_budget (int): The maximum reasoning token budget for thinking mode.
|
|
38
|
+
|
|
39
|
+
Basic usage:
|
|
40
|
+
The `PortkeyLMInvoker` supports multiple authentication methods with strict precedence order.
|
|
41
|
+
Authentication methods are mutually exclusive and cannot be combined.
|
|
42
|
+
|
|
43
|
+
**Authentication Precedence (Highest to Lowest):**
|
|
44
|
+
1. **Config ID Authentication (Highest precedence)**
|
|
45
|
+
Use a pre-configured routing setup from Portkey’s dashboard.
|
|
46
|
+
```python
|
|
47
|
+
lm_invoker = PortkeyLMInvoker(
|
|
48
|
+
portkey_api_key="<your-portkey-api-key>",
|
|
49
|
+
config="pc-openai-4f6905",
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
2. **Model Catalog Authentication**
|
|
54
|
+
Provider name must match the provider name set in the model catalog.
|
|
55
|
+
More details to set up the model catalog can be found in https://portkey.ai/docs/product/model-catalog#model-catalog.
|
|
56
|
+
There are two ways to specify the model name:
|
|
57
|
+
|
|
58
|
+
2.1. Using Combined Model Name Format
|
|
59
|
+
Specify the `model_name` in \'@provider-name/model-name\' format.
|
|
60
|
+
```python
|
|
61
|
+
lm_invoker = PortkeyLMInvoker(
|
|
62
|
+
portkey_api_key="<your-portkey-api-key>",
|
|
63
|
+
model_name="@openai-custom/gpt-4o"
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
2.2. Using Separate Provider and Model Name Parameters
|
|
68
|
+
Specify the `provider` in \'@provider-name\' format and `model_name` separately.
|
|
69
|
+
```python
|
|
70
|
+
lm_invoker = PortkeyLMInvoker(
|
|
71
|
+
portkey_api_key="<your-portkey-api-key>",
|
|
72
|
+
provider="@openai-custom",
|
|
73
|
+
model_name="gpt-4o",
|
|
74
|
+
)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
3. **Direct Provider Authentication**
|
|
78
|
+
Use the `provider` in \'provider-name\' format and `model_name` parameters.
|
|
79
|
+
```python
|
|
80
|
+
lm_invoker = PortkeyLMInvoker(
|
|
81
|
+
portkey_api_key="<your-portkey-api-key>",
|
|
82
|
+
provider="openai",
|
|
83
|
+
model_name="gpt-4o",
|
|
84
|
+
api_key="sk-...",
|
|
85
|
+
)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Custom Host:
|
|
89
|
+
You can also use the `custom_host` parameter to override the default host. This is available
|
|
90
|
+
for all authentication methods except for Config ID authentication.
|
|
91
|
+
```python
|
|
92
|
+
lm_invoker = PortkeyLMInvoker(..., custom_host="https://your-custom-endpoint.com")
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Input types:
|
|
96
|
+
The `PortkeyLMInvoker` supports text, image, document, and audio inputs.
|
|
97
|
+
Non-text inputs can be passed as an `Attachment` object with the `user` role.
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
text = "What animal is in this image?"
|
|
101
|
+
image = Attachment.from_path("path/to/image.png")
|
|
102
|
+
result = await lm_invoker.invoke([text, image])
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Tool calling:
|
|
106
|
+
Tools can be provided via the `tools` parameter to enable tool invocation.
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
lm_invoker = PortkeyLMInvoker(..., tools=[tool_1, tool_2])
|
|
110
|
+
```
|
|
111
|
+
Output example:
|
|
112
|
+
```python
|
|
113
|
+
LMOutput(
|
|
114
|
+
response="Let me call the tools...",
|
|
115
|
+
tool_calls=[
|
|
116
|
+
ToolCall(id="123", name="tool_1", args={"key": "value"}),
|
|
117
|
+
]
|
|
118
|
+
)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Structured output:
|
|
122
|
+
The `response_schema` parameter enables structured responses (Pydantic BaseModel or JSON schema).
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
class Animal(BaseModel):
|
|
126
|
+
name: str
|
|
127
|
+
color: str
|
|
128
|
+
lm_invoker = PortkeyLMInvoker(..., response_schema=Animal)
|
|
129
|
+
```
|
|
130
|
+
Output example:
|
|
131
|
+
```python
|
|
132
|
+
LMOutput(structured_output=Animal(name="Golden retriever", color="Golden"))
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Analytics tracking:
|
|
136
|
+
When `output_analytics=True`, the invoker includes token usage, duration, and finish details.
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
LMOutput(
|
|
140
|
+
response="Golden retriever is a good dog breed.",
|
|
141
|
+
token_usage=TokenUsage(input_tokens=100, output_tokens=50),
|
|
142
|
+
duration=0.729,
|
|
143
|
+
finish_details={"finish_reason": "stop"},
|
|
144
|
+
)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Note:** When streaming is enabled, token usage analytics are not supported and will be `None`.
|
|
148
|
+
|
|
149
|
+
Retry and timeout:
|
|
150
|
+
The `PortkeyLMInvoker` supports retry and timeout configuration.
|
|
151
|
+
By default, the max retries is set to 0 and the timeout is set to 30.0 seconds.
|
|
152
|
+
They can be customized by providing a custom `RetryConfig` object to the `retry_config` parameter.
|
|
153
|
+
|
|
154
|
+
Retry config examples:
|
|
155
|
+
```python
|
|
156
|
+
retry_config = RetryConfig(max_retries=0, timeout=None) # No retry, no timeout
|
|
157
|
+
retry_config = RetryConfig(max_retries=0, timeout=10.0) # No retry, 10.0 seconds timeout
|
|
158
|
+
retry_config = RetryConfig(max_retries=5, timeout=None) # 5 max retries, no timeout
|
|
159
|
+
retry_config = RetryConfig(max_retries=5, timeout=10.0) # 5 max retries, 10.0 seconds timeout
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Usage example:
|
|
163
|
+
```python
|
|
164
|
+
lm_invoker = PortkeyLMInvoker(..., retry_config=retry_config)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Thinking:
|
|
168
|
+
The `thinking` parameter enables enhanced reasoning capability for supported models.
|
|
169
|
+
Thinking mode allocates additional “reasoning tokens” up to `thinking_budget` (minimum 1024).
|
|
170
|
+
When enabled, the model’s reasoning trace is stored in the `reasoning` attribute.
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
lm_invoker = PortkeyLMInvoker(..., thinking=True, thinking_budget=1024)
|
|
174
|
+
```
|
|
175
|
+
Output example:
|
|
176
|
+
```python
|
|
177
|
+
LMOutput(
|
|
178
|
+
response="Golden retriever is a good dog breed.",
|
|
179
|
+
reasoning=[Reasoning(reasoning="Let me think about it...")],
|
|
180
|
+
)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Streaming output example:
|
|
184
|
+
```python
|
|
185
|
+
{"type": "thinking_start", "value": ""}
|
|
186
|
+
{"type": "thinking", "value": "Let me think "}
|
|
187
|
+
{"type": "thinking", "value": "about it..."}
|
|
188
|
+
{"type": "thinking_end", "value": ""}
|
|
189
|
+
{"type": "response", "value": "Golden retriever "}
|
|
190
|
+
{"type": "response", "value": "is a good dog breed."}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Note: By default, the thinking token will be streamed with the legacy `EventType.DATA` event type.
|
|
194
|
+
To use the new simplified streamed event format, set the `simplify_events` parameter to `True` during
|
|
195
|
+
LM invoker initialization. The legacy event format support will be removed in v0.6.
|
|
196
|
+
|
|
197
|
+
When thinking is enabled, the amount of tokens allocated for the thinking process can be set via the
|
|
198
|
+
`thinking_budget` parameter. The `thinking_budget`:
|
|
199
|
+
1. Must be a positive integer.
|
|
200
|
+
2. Must be at least 1024.
|
|
201
|
+
3. Must be less than or equal to the model\'s maximum context length.
|
|
202
|
+
For more information, please refer to https://portkey.ai/docs/product/ai-gateway/multimodal-capabilities/thinking-mode
|
|
203
|
+
|
|
204
|
+
Setting reasoning-related parameters for non-reasoning models will raise an error.
|
|
205
|
+
|
|
206
|
+
Output types:
|
|
207
|
+
The output of the `PortkeyLMInvoker` can either be:
|
|
208
|
+
1. `str`: A simple text response.
|
|
209
|
+
2. `LMOutput`: A structured response model that may contain:
|
|
210
|
+
2.1. response (str)
|
|
211
|
+
2.2. tool_calls (list[ToolCall])
|
|
212
|
+
2.3. structured_output (dict[str, Any] | BaseModel | None)
|
|
213
|
+
2.4. token_usage (TokenUsage | None)
|
|
214
|
+
2.5. duration (float | None)
|
|
215
|
+
2.6. finish_details (dict[str, Any] | None)
|
|
216
|
+
2.7. reasoning (list[Reasoning])
|
|
217
|
+
'''
|
|
218
|
+
model_kwargs: Incomplete
|
|
219
|
+
thinking: Incomplete
|
|
220
|
+
thinking_budget: Incomplete
|
|
221
|
+
client_kwargs: Incomplete
|
|
222
|
+
client: Incomplete
|
|
223
|
+
def __init__(self, model_name: str | None = None, portkey_api_key: str | None = None, provider: str | None = None, api_key: str | None = None, config: str | None = None, custom_host: str | None = None, model_kwargs: dict[str, Any] | None = None, default_hyperparameters: dict[str, Any] | None = None, tools: list[Tool | LangChainTool] | None = None, response_schema: ResponseSchema | None = None, output_analytics: bool = False, retry_config: RetryConfig | None = None, thinking: bool | None = None, thinking_budget: int | None = None, simplify_events: bool = False) -> None:
|
|
224
|
+
"""Initializes a new instance of the PortkeyLMInvoker class.
|
|
225
|
+
|
|
226
|
+
Args:
|
|
227
|
+
model_name (str | None, optional): The name of the model to use. Acceptable formats:
|
|
228
|
+
1. 'model' for direct authentication,
|
|
229
|
+
2. '@provider-slug/model' for model catalog authentication.
|
|
230
|
+
Defaults to None.
|
|
231
|
+
portkey_api_key (str | None, optional): The Portkey API key. Defaults to None, in which
|
|
232
|
+
case the `PORTKEY_API_KEY` environment variable will be used.
|
|
233
|
+
provider (str | None, optional): Provider name or catalog slug. Acceptable formats:
|
|
234
|
+
1. '@provider-slug' for model catalog authentication (no api_key needed),
|
|
235
|
+
2. 'provider' for direct authentication (requires api_key).
|
|
236
|
+
Will be combined with model_name if model name is not in the format '@provider-slug/model'.
|
|
237
|
+
Defaults to None.
|
|
238
|
+
api_key (str | None, optional): Provider's API key for direct authentication.
|
|
239
|
+
Must be used with 'provider' parameter (without '@' prefix). Not needed for catalog providers.
|
|
240
|
+
Defaults to None.
|
|
241
|
+
config (str | None, optional): Portkey config ID for complex routing configurations,
|
|
242
|
+
load balancing, or fallback scenarios. Defaults to None.
|
|
243
|
+
custom_host (str | None, optional): Custom host URL for self-hosted or custom endpoints.
|
|
244
|
+
Can be combined with catalog providers. Defaults to None.
|
|
245
|
+
model_kwargs (dict[str, Any] | None, optional): Additional model parameters and authentication.
|
|
246
|
+
Defaults to None.
|
|
247
|
+
default_hyperparameters (dict[str, Any] | None, optional): Default hyperparameters for model
|
|
248
|
+
invocation (temperature, max_tokens, etc.). Defaults to None.
|
|
249
|
+
tools (list[Tool | LangChainTool] | None, optional): Tools for enabling tool calling functionality.
|
|
250
|
+
Defaults to None.
|
|
251
|
+
response_schema (ResponseSchema | None, optional): Schema for structured output generation.
|
|
252
|
+
Defaults to None.
|
|
253
|
+
output_analytics (bool, optional): Whether to output detailed invocation analytics including
|
|
254
|
+
token usage and timing. Defaults to False.
|
|
255
|
+
retry_config (RetryConfig | None, optional): Configuration for retry behavior on failures.
|
|
256
|
+
Defaults to None.
|
|
257
|
+
thinking (bool | None, optional): Whether to enable thinking mode. Defaults to None.
|
|
258
|
+
thinking_budget (int | None, optional): Thinking budget in tokens. Defaults to None.
|
|
259
|
+
simplify_events (bool, optional): Whether to use simplified event schemas. Defaults to False.
|
|
260
|
+
"""
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
class Key:
|
|
2
|
+
"""Valid keys in Portkey."""
|
|
3
|
+
AUTHORIZATION: str
|
|
4
|
+
BUDGET_TOKENS: str
|
|
5
|
+
CONFIG: str
|
|
6
|
+
CONTENT: str
|
|
7
|
+
CONTENT_BLOCKS: str
|
|
8
|
+
CUSTOM_HOST: str
|
|
9
|
+
DELTA: str
|
|
10
|
+
MAX_RETRIES: str
|
|
11
|
+
MODEL: str
|
|
12
|
+
PROVIDER: str
|
|
13
|
+
PROVIDER_MODEL: str
|
|
14
|
+
REQUEST_TIMEOUT: str
|
|
15
|
+
RESPONSE_FORMAT: str
|
|
16
|
+
STRICT_OPEN_AI_COMPLIANCE: str
|
|
17
|
+
THINKING: str
|
|
18
|
+
TOOLS: str
|
|
19
|
+
TYPE: str
|
|
20
|
+
USAGE: str
|
|
21
|
+
|
|
22
|
+
class InputType:
|
|
23
|
+
"""Valid input types in Portkey."""
|
|
24
|
+
ENABLED: str
|
|
25
|
+
|
|
26
|
+
class AuthConfig:
|
|
27
|
+
"""Authentication configuration keys."""
|
|
28
|
+
CONFIG: str
|
|
29
|
+
MODEL: str
|
|
30
|
+
PROVIDER_AUTH: str
|
|
31
|
+
PROVIDER_CUSTOM_HOST: str
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
from gllm_inference.prompt_builder.format_strategy.jinja_format_strategy import JinjaFormatStrategy as JinjaFormatStrategy
|
|
2
|
+
from gllm_inference.prompt_builder.format_strategy.string_format_strategy import StringFormatStrategy as StringFormatStrategy
|
|
3
|
+
|
|
4
|
+
__all__ = ['StringFormatStrategy', 'JinjaFormatStrategy']
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from gllm_inference.schema.message import MessageContent as MessageContent
|
|
5
|
+
|
|
6
|
+
class BasePromptFormattingStrategy(ABC, metaclass=abc.ABCMeta):
|
|
7
|
+
"""Base class for prompt formatting strategies.
|
|
8
|
+
|
|
9
|
+
This class defines the interface for different prompt templating engines. Subclasses
|
|
10
|
+
implement specific formatting strategies to render templates with variable
|
|
11
|
+
substitution.
|
|
12
|
+
|
|
13
|
+
The strategy pattern allows the PromptBuilder to work with different templating engines
|
|
14
|
+
without changing its core logic.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
key_defaults (dict[str, str]): The default values for the keys.
|
|
18
|
+
"""
|
|
19
|
+
key_defaults: Incomplete
|
|
20
|
+
def __init__(self, key_defaults: dict[str, str] | None = None) -> None:
|
|
21
|
+
"""Initialize the BasePromptFormattingStrategy.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
key_defaults (dict[str, str] | None, optional): The default values for the keys. Defaults to None,
|
|
25
|
+
in which case no default values are used.
|
|
26
|
+
"""
|
|
27
|
+
def format(self, template: str, variables_map: dict[str, str] | None = None, extra_contents: list[MessageContent] | None = None) -> list[str]:
|
|
28
|
+
"""Format template with variables using the template method pattern.
|
|
29
|
+
|
|
30
|
+
This is a template method that defines the algorithm for formatting:
|
|
31
|
+
1. Merge key_defaults and variables_map
|
|
32
|
+
2. Render the template (delegated to subclass via _render_template)
|
|
33
|
+
3. Append extra_contents to the result
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
template (str): Template string to format.
|
|
37
|
+
variables_map (dict[str, str] | None, optional): Variables for substitution. Defaults to None.
|
|
38
|
+
extra_contents (list[MessageContent] | None, optional): Extra contents to format. Defaults to None.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
str: Formatted template string.
|
|
42
|
+
"""
|
|
43
|
+
@abstractmethod
|
|
44
|
+
def extract_keys(self, template: str | None) -> set[str]:
|
|
45
|
+
"""Extract variable keys from template.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
template (str | None): Template string to extract keys from.
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
set[str]: Set of variable keys found in template.
|
|
52
|
+
|
|
53
|
+
Raises:
|
|
54
|
+
NotImplementedError: If the method is not implemented.
|
|
55
|
+
"""
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from gllm_inference.prompt_builder.format_strategy.format_strategy import BasePromptFormattingStrategy as BasePromptFormattingStrategy
|
|
3
|
+
from gllm_inference.schema import JinjaEnvType as JinjaEnvType
|
|
4
|
+
from jinja2.sandbox import SandboxedEnvironment
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
JINJA_DEFAULT_BLACKLISTED_FILTERS: list[str]
|
|
8
|
+
JINJA_DEFAULT_SAFE_GLOBALS: dict[str, Any]
|
|
9
|
+
JINJA_DANGEROUS_PATTERNS: list[str]
|
|
10
|
+
PROMPT_BUILDER_VARIABLE_START_STRING: str
|
|
11
|
+
PROMPT_BUILDER_VARIABLE_END_STRING: str
|
|
12
|
+
|
|
13
|
+
class JinjaFormatStrategy(BasePromptFormattingStrategy):
|
|
14
|
+
"""Jinja2 template engine for formatting prompts.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
jinja_env (SandboxedEnvironment): The Jinja environment for rendering templates.
|
|
18
|
+
key_defaults (dict[str, str]): The default values for the keys.
|
|
19
|
+
"""
|
|
20
|
+
jinja_env: Incomplete
|
|
21
|
+
def __init__(self, environment: JinjaEnvType | SandboxedEnvironment = ..., key_defaults: dict[str, str] | None = None) -> None:
|
|
22
|
+
"""Initialize the JinjaFormatStrategy.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
environment (JinjaEnvType | SandboxedEnvironment, optional): The environment for Jinja rendering.
|
|
26
|
+
It can be one of the following:
|
|
27
|
+
1. `JinjaEnvType.RESTRICTED`: Uses a minimal, restricted Jinja environment.
|
|
28
|
+
Safest for most cases.
|
|
29
|
+
2. `JinjaEnvType.JINJA_DEFAULT`: Uses the full Jinja environment. Allows more powerful templating,
|
|
30
|
+
but with fewer safety restrictions.
|
|
31
|
+
3. `SandboxedEnvironment` instance: A custom Jinja `SandboxedEnvironment` object provided by the
|
|
32
|
+
user. Offers fine-grained control over template execution.
|
|
33
|
+
Defaults to `JinjaEnvType.RESTRICTED`
|
|
34
|
+
key_defaults (dict[str, str], optional): The default values for the keys. Defaults to None, in which
|
|
35
|
+
case no default values are used.
|
|
36
|
+
"""
|
|
37
|
+
def extract_keys(self, template: str | None) -> set[str]:
|
|
38
|
+
"""Extract keys from Jinja template using AST analysis.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
template (str | None): The template to extract keys from.
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
set[str]: The set of keys found in the template.
|
|
45
|
+
"""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from gllm_inference.prompt_builder.format_strategy.format_strategy import BasePromptFormattingStrategy as BasePromptFormattingStrategy
|
|
3
|
+
|
|
4
|
+
KEY_EXTRACTOR_REGEX: Incomplete
|
|
5
|
+
|
|
6
|
+
class StringFormatStrategy(BasePromptFormattingStrategy):
|
|
7
|
+
"""String format strategy using str.format() method.
|
|
8
|
+
|
|
9
|
+
Attributes:
|
|
10
|
+
key_defaults (dict[str, str]): The default values for the keys.
|
|
11
|
+
"""
|
|
12
|
+
def extract_keys(self, template: str | None) -> set[str]:
|
|
13
|
+
"""Extract keys from a template.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
template (str | None): The template to extract keys from.
|
|
17
|
+
|
|
18
|
+
Returns:
|
|
19
|
+
set[str]: The set of keys found in the template.
|
|
20
|
+
"""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
|
-
from gllm_inference.
|
|
2
|
+
from gllm_inference.prompt_builder.format_strategy import JinjaFormatStrategy as JinjaFormatStrategy, StringFormatStrategy as StringFormatStrategy
|
|
3
|
+
from gllm_inference.schema import JinjaEnvType as JinjaEnvType, Message as Message, MessageContent as MessageContent, MessageRole as MessageRole
|
|
4
|
+
from jinja2.sandbox import SandboxedEnvironment as SandboxedEnvironment
|
|
3
5
|
from typing import Any
|
|
4
6
|
|
|
5
|
-
KEY_EXTRACTOR_REGEX: Incomplete
|
|
6
|
-
|
|
7
7
|
class PromptBuilder:
|
|
8
8
|
"""A prompt builder class used in Gen AI applications.
|
|
9
9
|
|
|
@@ -12,12 +12,14 @@ class PromptBuilder:
|
|
|
12
12
|
user_template (str): The user prompt template. May contain placeholders enclosed in curly braces `{}`.
|
|
13
13
|
prompt_key_set (set[str]): A set of expected keys that must be present in the prompt templates.
|
|
14
14
|
key_defaults (dict[str, str]): Default values for the keys in the prompt templates.
|
|
15
|
+
strategy (BasePromptFormattingStrategy): The format strategy to be used for formatting the prompt.
|
|
15
16
|
"""
|
|
17
|
+
key_defaults: Incomplete
|
|
16
18
|
system_template: Incomplete
|
|
17
19
|
user_template: Incomplete
|
|
20
|
+
strategy: Incomplete
|
|
18
21
|
prompt_key_set: Incomplete
|
|
19
|
-
key_defaults:
|
|
20
|
-
def __init__(self, system_template: str = '', user_template: str = '', key_defaults: dict[str, str] | None = None, ignore_extra_keys: bool | None = None) -> None:
|
|
22
|
+
def __init__(self, system_template: str = '', user_template: str = '', key_defaults: dict[str, str] | None = None, ignore_extra_keys: bool | None = None, use_jinja: bool = False, jinja_env: JinjaEnvType | SandboxedEnvironment = ...) -> None:
|
|
21
23
|
"""Initializes a new instance of the PromptBuilder class.
|
|
22
24
|
|
|
23
25
|
Args:
|
|
@@ -30,6 +32,17 @@ class PromptBuilder:
|
|
|
30
32
|
Defaults to None, in which case no default values will be assigned to the keys.
|
|
31
33
|
ignore_extra_keys (bool | None, optional): Deprecated parameter. Will be removed in v0.6. Extra keys
|
|
32
34
|
will always raise a warning only instead of raising an error.
|
|
35
|
+
use_jinja (bool, optional): Whether to use Jinja for rendering the prompt templates.
|
|
36
|
+
Defaults to False.
|
|
37
|
+
jinja_env (JinjaEnvType | SandboxedEnvironment, optional): The environment for Jinja rendering.
|
|
38
|
+
It can be one of the following:
|
|
39
|
+
1. `JinjaEnvType.RESTRICTED`: Uses a minimal, restricted Jinja environment.
|
|
40
|
+
Safest for most cases.
|
|
41
|
+
2. `JinjaEnvType.JINJA_DEFAULT`: Uses the full Jinja environment. Allows more powerful templating,
|
|
42
|
+
but with fewer safety restrictions.
|
|
43
|
+
3. `SandboxedEnvironment` instance: A custom Jinja `SandboxedEnvironment` object provided by the
|
|
44
|
+
user. Offers fine-grained control over template execution.
|
|
45
|
+
Defaults to `JinjaEnvType.RESTRICTED`
|
|
33
46
|
|
|
34
47
|
Raises:
|
|
35
48
|
ValueError: If both `system_template` and `user_template` are empty.
|
|
@@ -49,7 +62,7 @@ class PromptBuilder:
|
|
|
49
62
|
Values must be either a string or an object that can be serialized to a string.
|
|
50
63
|
|
|
51
64
|
Returns:
|
|
52
|
-
list[Message]: A
|
|
65
|
+
list[Message]: A list of formatted messages.
|
|
53
66
|
|
|
54
67
|
Raises:
|
|
55
68
|
ValueError: If a required key for the prompt template is missing from `kwargs`.
|
|
@@ -2,7 +2,7 @@ from gllm_inference.schema.activity import Activity as Activity, MCPCallActivity
|
|
|
2
2
|
from gllm_inference.schema.attachment import Attachment as Attachment
|
|
3
3
|
from gllm_inference.schema.code_exec_result import CodeExecResult as CodeExecResult
|
|
4
4
|
from gllm_inference.schema.config import TruncationConfig as TruncationConfig
|
|
5
|
-
from gllm_inference.schema.enums import AttachmentType as AttachmentType, BatchStatus as BatchStatus, EmitDataType as EmitDataType, LMEventType as LMEventType, MessageRole as MessageRole, TruncateSide as TruncateSide
|
|
5
|
+
from gllm_inference.schema.enums import AttachmentType as AttachmentType, BatchStatus as BatchStatus, EmitDataType as EmitDataType, JinjaEnvType as JinjaEnvType, LMEventType as LMEventType, MessageRole as MessageRole, TruncateSide as TruncateSide
|
|
6
6
|
from gllm_inference.schema.events import ActivityEvent as ActivityEvent, CodeEvent as CodeEvent, ThinkingEvent as ThinkingEvent
|
|
7
7
|
from gllm_inference.schema.lm_input import LMInput as LMInput
|
|
8
8
|
from gllm_inference.schema.lm_output import LMOutput as LMOutput
|
|
@@ -15,4 +15,4 @@ from gllm_inference.schema.tool_call import ToolCall as ToolCall
|
|
|
15
15
|
from gllm_inference.schema.tool_result import ToolResult as ToolResult
|
|
16
16
|
from gllm_inference.schema.type_alias import EMContent as EMContent, MessageContent as MessageContent, ResponseSchema as ResponseSchema, Vector as Vector
|
|
17
17
|
|
|
18
|
-
__all__ = ['Activity', 'ActivityEvent', 'Attachment', 'AttachmentType', 'BatchStatus', 'CodeEvent', 'CodeExecResult', 'EMContent', 'EmitDataType', 'LMEventType', 'InputTokenDetails', 'LMInput', 'LMOutput', 'MCPCall', 'MCPCallActivity', 'MCPListToolsActivity', 'MCPServer', 'Message', 'MessageContent', 'MessageRole', 'ModelId', 'ModelProvider', 'OutputTokenDetails', 'Reasoning', 'ThinkingEvent', 'ResponseSchema', 'TokenUsage', 'ToolCall', 'ToolResult', 'TruncateSide', 'TruncationConfig', 'Vector', 'WebSearchActivity']
|
|
18
|
+
__all__ = ['Activity', 'ActivityEvent', 'Attachment', 'AttachmentType', 'BatchStatus', 'CodeEvent', 'CodeExecResult', 'EMContent', 'EmitDataType', 'LMEventType', 'InputTokenDetails', 'JinjaEnvType', 'LMInput', 'LMOutput', 'MCPCall', 'MCPCallActivity', 'MCPListToolsActivity', 'MCPServer', 'Message', 'MessageContent', 'MessageRole', 'ModelId', 'ModelProvider', 'OutputTokenDetails', 'Reasoning', 'ThinkingEvent', 'ResponseSchema', 'TokenUsage', 'ToolCall', 'ToolResult', 'TruncateSide', 'TruncationConfig', 'Vector', 'WebSearchActivity']
|
gllm_inference/schema/enums.pyi
CHANGED
|
@@ -54,6 +54,11 @@ class TruncateSide(StrEnum):
|
|
|
54
54
|
RIGHT = 'RIGHT'
|
|
55
55
|
LEFT = 'LEFT'
|
|
56
56
|
|
|
57
|
+
class JinjaEnvType(StrEnum):
|
|
58
|
+
"""Enumeration for Jinja environment types."""
|
|
59
|
+
JINJA_DEFAULT = 'jinja_default'
|
|
60
|
+
RESTRICTED = 'restricted'
|
|
61
|
+
|
|
57
62
|
class WebSearchKey(StrEnum):
|
|
58
63
|
"""Defines valid web search keys."""
|
|
59
64
|
PATTERN = 'pattern'
|
|
Binary file
|
gllm_inference.pyi
CHANGED
|
@@ -32,6 +32,7 @@ import gllm_inference.lm_invoker.LiteLLMLMInvoker
|
|
|
32
32
|
import gllm_inference.lm_invoker.OpenAIChatCompletionsLMInvoker
|
|
33
33
|
import gllm_inference.lm_invoker.OpenAICompatibleLMInvoker
|
|
34
34
|
import gllm_inference.lm_invoker.OpenAILMInvoker
|
|
35
|
+
import gllm_inference.lm_invoker.PortkeyLMInvoker
|
|
35
36
|
import gllm_inference.lm_invoker.XAILMInvoker
|
|
36
37
|
import gllm_inference.prompt_builder.PromptBuilder
|
|
37
38
|
import gllm_inference.output_parser.JSONOutputParser
|
|
@@ -125,15 +126,21 @@ import gllm_inference.schema.MCPCallActivity
|
|
|
125
126
|
import gllm_inference.schema.MCPListToolsActivity
|
|
126
127
|
import gllm_inference.schema.MCPServer
|
|
127
128
|
import gllm_inference.schema.WebSearchActivity
|
|
129
|
+
import logging
|
|
130
|
+
import portkey_ai
|
|
128
131
|
import xai_sdk
|
|
129
132
|
import xai_sdk.chat
|
|
130
133
|
import xai_sdk.search
|
|
131
134
|
import xai_sdk.proto
|
|
132
135
|
import xai_sdk.proto.v5
|
|
133
136
|
import xai_sdk.proto.v5.chat_pb2
|
|
137
|
+
import jinja2
|
|
138
|
+
import jinja2.sandbox
|
|
139
|
+
import gllm_inference.schema.JinjaEnvType
|
|
140
|
+
import gllm_inference.prompt_builder.format_strategy.JinjaFormatStrategy
|
|
141
|
+
import gllm_inference.prompt_builder.format_strategy.StringFormatStrategy
|
|
134
142
|
import transformers
|
|
135
143
|
import gllm_inference.prompt_formatter.HuggingFacePromptFormatter
|
|
136
|
-
import logging
|
|
137
144
|
import traceback
|
|
138
145
|
import gllm_inference.realtime_chat.input_streamer.KeyboardInputStreamer
|
|
139
146
|
import gllm_inference.realtime_chat.output_streamer.ConsoleOutputStreamer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: gllm-inference-binary
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.46
|
|
4
4
|
Summary: A library containing components related to model inferences in Gen AI applications.
|
|
5
5
|
Author-email: Henry Wicaksono <henry.wicaksono@gdplabs.id>, Resti Febrina <resti.febrina@gdplabs.id>
|
|
6
6
|
Requires-Python: <3.14,>=3.11
|
|
@@ -39,10 +39,12 @@ Requires-Dist: google-genai<=1.36,>=1.23; extra == "google"
|
|
|
39
39
|
Provides-Extra: huggingface
|
|
40
40
|
Requires-Dist: huggingface-hub<0.31.0,>=0.30.0; extra == "huggingface"
|
|
41
41
|
Requires-Dist: transformers<5.0.0,>=4.52.0; extra == "huggingface"
|
|
42
|
-
Provides-Extra: openai
|
|
43
|
-
Requires-Dist: openai<2.0.0,>=1.98.0; extra == "openai"
|
|
44
42
|
Provides-Extra: litellm
|
|
45
43
|
Requires-Dist: litellm<2.0.0,>=1.69.2; extra == "litellm"
|
|
44
|
+
Provides-Extra: openai
|
|
45
|
+
Requires-Dist: openai<2.0.0,>=1.98.0; extra == "openai"
|
|
46
|
+
Provides-Extra: portkey-ai
|
|
47
|
+
Requires-Dist: portkey-ai<2.0.0,>=1.14.4; extra == "portkey-ai"
|
|
46
48
|
Provides-Extra: twelvelabs
|
|
47
49
|
Requires-Dist: twelvelabs<0.5.0,>=0.4.4; extra == "twelvelabs"
|
|
48
50
|
Provides-Extra: voyage
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
gllm_inference.cp313-win_amd64.pyd,sha256=
|
|
2
|
-
gllm_inference.pyi,sha256=
|
|
1
|
+
gllm_inference.cp313-win_amd64.pyd,sha256=FmGdE_EHin-8qlPX4uCTEXqCpQn9yIE_m6z171rHitM,3811840
|
|
2
|
+
gllm_inference.pyi,sha256=1WeCtSLoqo97eCY-WiMP-LF9UUJG_pT5NTESuCoStRg,5211
|
|
3
3
|
gllm_inference/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
gllm_inference/constants.pyi,sha256=PncjVw-mkzcJ3ln1ohvVZGdJ-TD-VZy1Ygn4Va8Z7i0,350
|
|
5
5
|
gllm_inference/builder/__init__.pyi,sha256=-bw1uDx7CAM7pkvjvb1ZXku9zXlQ7aEAyC83KIn3bz8,506
|
|
6
6
|
gllm_inference/builder/build_em_invoker.pyi,sha256=3vO_pLokR4BAZflOMu6qzXoKx6vibT16uwJETH5Y_yc,6283
|
|
7
|
-
gllm_inference/builder/build_lm_invoker.pyi,sha256=
|
|
7
|
+
gllm_inference/builder/build_lm_invoker.pyi,sha256=mGMFjTmflPjfz9gRhnLzfdAnumSGfLuXFt4W76ZHSJw,9520
|
|
8
8
|
gllm_inference/builder/build_lm_request_processor.pyi,sha256=H7Rg88e7PTTCtuyY64r333moTmh4-ypOwgnG10gkEdY,4232
|
|
9
9
|
gllm_inference/builder/build_output_parser.pyi,sha256=sgSTrzUmSRxPzUUum0fDU7A3NXYoYhpi6bEx4Q2XMnA,965
|
|
10
10
|
gllm_inference/catalog/__init__.pyi,sha256=HWgPKWIzprpMHRKe_qN9BZSIQhVhrqiyjLjIXwvj1ho,291
|
|
@@ -39,7 +39,7 @@ gllm_inference/exceptions/__init__.pyi,sha256=nXOqwsuwUgsnBcJEANVuxbZ1nDfcJ6-pKU
|
|
|
39
39
|
gllm_inference/exceptions/error_parser.pyi,sha256=4aiJZhBzBOqlhdmpvaCvildGy7_XxlJzQpe3PzGt8eE,2040
|
|
40
40
|
gllm_inference/exceptions/exceptions.pyi,sha256=6y3ECgHAStqMGgQv8Dv-Ui-5PDD07mSj6qaRZeSWea4,5857
|
|
41
41
|
gllm_inference/exceptions/provider_error_map.pyi,sha256=vWa4ZIHn7qIghECGvO-dS2KzOmf3c10GRWKZ4YDPnSQ,1267
|
|
42
|
-
gllm_inference/lm_invoker/__init__.pyi,sha256=
|
|
42
|
+
gllm_inference/lm_invoker/__init__.pyi,sha256=L2nlkj13WwWbDYEBtM0mlAj0-UbSilMjVLpCJ_0Eock,1502
|
|
43
43
|
gllm_inference/lm_invoker/anthropic_lm_invoker.pyi,sha256=JSgKUk9d1ZHlitv_ZjHlAk2hIW-J7u6yslVHflIeUro,16726
|
|
44
44
|
gllm_inference/lm_invoker/azure_openai_lm_invoker.pyi,sha256=FYfRNPG-oD4wIfitjTHnGib1uMZL7Pid0gbrRsymAHU,14601
|
|
45
45
|
gllm_inference/lm_invoker/bedrock_lm_invoker.pyi,sha256=dsNxj3ZfHxUplg6nBLgxVGooGYq1QP89gYzCnmRCz3g,11810
|
|
@@ -51,6 +51,7 @@ gllm_inference/lm_invoker/lm_invoker.pyi,sha256=PS4cJ5VLNfHqeTgCerY-c1Xaa7ktdWAi
|
|
|
51
51
|
gllm_inference/lm_invoker/openai_chat_completions_lm_invoker.pyi,sha256=uYJFgi4tJGab77232IC1gdoU9h9AqoClIUj6tM6O47s,15177
|
|
52
52
|
gllm_inference/lm_invoker/openai_compatible_lm_invoker.pyi,sha256=T9sShA_9fgEuaaAuT2gJZq_EYNbEhf3IkWwMCwfszY8,4244
|
|
53
53
|
gllm_inference/lm_invoker/openai_lm_invoker.pyi,sha256=10iKCyleqHNbJc8M1rj3ogRcNlNxcVgyk0v6TcS6gf4,23452
|
|
54
|
+
gllm_inference/lm_invoker/portkey_lm_invoker.pyi,sha256=BmZ5TFiQx3-6Ijf6J2ICzP6SCfnOFUVTPRLijv85oU0,13465
|
|
54
55
|
gllm_inference/lm_invoker/xai_lm_invoker.pyi,sha256=gyi12K7M9HkjNX6pU6NVv5Uq3-aHErixO-PVhHjioo8,14632
|
|
55
56
|
gllm_inference/lm_invoker/batch/__init__.pyi,sha256=vJOTHRJ83oq8Bq0UsMdID9_HW5JAxr06gUs4aPRZfEE,130
|
|
56
57
|
gllm_inference/lm_invoker/batch/batch_operations.pyi,sha256=o2U17M41RKVFW6j_oxy-SxU1JqUtVt75pKRxrqXzorE,5499
|
|
@@ -62,6 +63,7 @@ gllm_inference/lm_invoker/schema/google.pyi,sha256=elXHrUMS46pbTsulk7hBXVVFcT022
|
|
|
62
63
|
gllm_inference/lm_invoker/schema/langchain.pyi,sha256=2OJOUQPlGdlUbIOTDOyiWDBOMm3MoVX-kU2nK0zQsF0,452
|
|
63
64
|
gllm_inference/lm_invoker/schema/openai.pyi,sha256=TsCr8_SM5kK2JyROeXtmH13n46TgKjLMc0agYlYUSZc,2328
|
|
64
65
|
gllm_inference/lm_invoker/schema/openai_chat_completions.pyi,sha256=nNPb7ETC9IrJwkV5wfbGf6Co3-qdq4lhcXz0l_qYCE4,1261
|
|
66
|
+
gllm_inference/lm_invoker/schema/portkey.pyi,sha256=V2q4JIwDAR7BidqfmO01u1_1mLOMtm5OCon6sN2zNt0,662
|
|
65
67
|
gllm_inference/lm_invoker/schema/xai.pyi,sha256=jpC6ZSBDUltzm9GjD6zvSFIPwqizn_ywLnjvwSa7KuU,663
|
|
66
68
|
gllm_inference/model/__init__.pyi,sha256=JKQB0wVSVYD-_tdRkG7N_oEVAKGCcoBw0BUOUMLieFo,602
|
|
67
69
|
gllm_inference/model/em/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -77,7 +79,11 @@ gllm_inference/output_parser/__init__.pyi,sha256=dhAeRTBxc6CfS8bhnHjbtrnyqJ1iyff
|
|
|
77
79
|
gllm_inference/output_parser/json_output_parser.pyi,sha256=YtgQh8Uzy8W_Tgh8DfuR7VFFS7qvLEasiTwRfaGZZEU,2993
|
|
78
80
|
gllm_inference/output_parser/output_parser.pyi,sha256=-Xu5onKCBDqShcO-VrQh5icqAmXdihGc3rkZxL93swg,975
|
|
79
81
|
gllm_inference/prompt_builder/__init__.pyi,sha256=mPsbiafzSNHsgN-CuzjhgZpfXfi1pPC3_gdsq2p0EM4,120
|
|
80
|
-
gllm_inference/prompt_builder/prompt_builder.pyi,sha256=
|
|
82
|
+
gllm_inference/prompt_builder/prompt_builder.pyi,sha256=67X0MXPRGb_Azifk5fM9lAsQX48rASsQk2gCPikqU5k,4626
|
|
83
|
+
gllm_inference/prompt_builder/format_strategy/__init__.pyi,sha256=BliNAdrN2yNoQt8muLe1IknuE78UDQys_3L_8_2Tn9E,312
|
|
84
|
+
gllm_inference/prompt_builder/format_strategy/format_strategy.pyi,sha256=Uay07qR0nMGbrOZ2twEyrIWYRKevBQL9ju_4fVfByyQ,2328
|
|
85
|
+
gllm_inference/prompt_builder/format_strategy/jinja_format_strategy.pyi,sha256=W8SdOPWPz_U355G8rQwiIQ0Ys78vomUBFEEZiz3AS5k,2270
|
|
86
|
+
gllm_inference/prompt_builder/format_strategy/string_format_strategy.pyi,sha256=Xbx8xAtj3AbgFuPY8A3OuC6MlwenjYm6OXnQwxAP45k,713
|
|
81
87
|
gllm_inference/prompt_formatter/__init__.pyi,sha256=q5sPPrnoCf-4tMGowh7hXxs63uyWfaZyEI-wjLBTGsA,747
|
|
82
88
|
gllm_inference/prompt_formatter/agnostic_prompt_formatter.pyi,sha256=qp4L3x7XK7oZaSYP8B4idewKpPioB4XELeKVV-dNi-Q,2067
|
|
83
89
|
gllm_inference/prompt_formatter/huggingface_prompt_formatter.pyi,sha256=kH60A_3DnHd3BrqbgS_FqQTCTHIjC9BTsk6_FNgcZw8,2784
|
|
@@ -99,18 +105,18 @@ gllm_inference/realtime_chat/output_streamer/output_streamer.pyi,sha256=5P9NQ0aJ
|
|
|
99
105
|
gllm_inference/request_processor/__init__.pyi,sha256=giEme2WFQhgyKiBZHhSet0_nKSCHwGy-_2p6NRzg0Zc,231
|
|
100
106
|
gllm_inference/request_processor/lm_request_processor.pyi,sha256=0fy1HyILCVDw6y46E-7tLnQTRYx4ppeRMe0QP6t9Jyw,5990
|
|
101
107
|
gllm_inference/request_processor/uses_lm_mixin.pyi,sha256=LYHq-zLoXEMel1LfVdYv7W3BZ8WtBLo_WWFjRf10Yto,6512
|
|
102
|
-
gllm_inference/schema/__init__.pyi,sha256=
|
|
108
|
+
gllm_inference/schema/__init__.pyi,sha256=Rv821pgyUUbcVhnGJ0CnXVWJMi2pgaglv6Pq4RHK7yE,2223
|
|
103
109
|
gllm_inference/schema/activity.pyi,sha256=atrU4OwLesA9FEt1H7K3gsUWYNdOqpI5i2VdWkmo6cs,2367
|
|
104
110
|
gllm_inference/schema/attachment.pyi,sha256=9zgAjGXBjLfzPGaKi68FMW6b5mXdEA352nDe-ynOSvY,3385
|
|
105
111
|
gllm_inference/schema/code_exec_result.pyi,sha256=WQ-ARoGM9r6nyRX-A0Ro1XKiqrc9R3jRYXZpu_xo5S4,573
|
|
106
112
|
gllm_inference/schema/config.pyi,sha256=NVmjQK6HipIE0dKSfx12hgIC0O-S1HEcAc-TWlXAF5A,689
|
|
107
|
-
gllm_inference/schema/enums.pyi,sha256=
|
|
113
|
+
gllm_inference/schema/enums.pyi,sha256=dN6FzT4zNbSfqVxmrl3hO7IIiP-Qy4lAP_tf4tp8dNI,1827
|
|
108
114
|
gllm_inference/schema/events.pyi,sha256=iG3sFAhvek-fSJgmUE6nJ5M0XzSpRKKpJJiXyuB4Wq0,5058
|
|
109
115
|
gllm_inference/schema/lm_input.pyi,sha256=HxQiZgY7zcXh_Dw8nK8LSeBTZEHMPZVwmPmnfgSsAbs,197
|
|
110
116
|
gllm_inference/schema/lm_output.pyi,sha256=DIV8BiIOPaSnMKxzKzH_Mp7j7-MScWCvmllegJDLqFg,2479
|
|
111
117
|
gllm_inference/schema/mcp.pyi,sha256=4SgQ83pEowfWm2p-w9lupV4NayqqVBOy7SuYxIFeWRs,1045
|
|
112
118
|
gllm_inference/schema/message.pyi,sha256=jJV6A0ihEcun2OhzyMtNkiHnf7d6v5R-GdpTBGfJ0AQ,2272
|
|
113
|
-
gllm_inference/schema/model_id.pyi,sha256=
|
|
119
|
+
gllm_inference/schema/model_id.pyi,sha256=Y9YjIOB5dRhs8EskAxoruFAzX0P3eu_xKD1huRM787M,5844
|
|
114
120
|
gllm_inference/schema/reasoning.pyi,sha256=jbPxkDRHt0Vt-zdcc8lTT1l2hIE1Jm3HIHeNd0hfXGo,577
|
|
115
121
|
gllm_inference/schema/token_usage.pyi,sha256=WJiGQyz5qatzBK2b-sABLCyTRLCBbAvxCRcqSJOzu-8,3025
|
|
116
122
|
gllm_inference/schema/tool_call.pyi,sha256=OWT9LUqs_xfUcOkPG0aokAAqzLYYDkfnjTa0zOWvugk,403
|
|
@@ -121,7 +127,7 @@ gllm_inference/utils/io_utils.pyi,sha256=Eg7dvHWdXslTKdjh1j3dG50i7r35XG2zTmJ9XXv
|
|
|
121
127
|
gllm_inference/utils/langchain.pyi,sha256=4AwFiVAO0ZpdgmqeC4Pb5NJwBt8vVr0MSUqLeCdTscc,1194
|
|
122
128
|
gllm_inference/utils/validation.pyi,sha256=-RdMmb8afH7F7q4Ao7x6FbwaDfxUHn3hA3WiOgzB-3s,397
|
|
123
129
|
gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
|
|
124
|
-
gllm_inference_binary-0.5.
|
|
125
|
-
gllm_inference_binary-0.5.
|
|
126
|
-
gllm_inference_binary-0.5.
|
|
127
|
-
gllm_inference_binary-0.5.
|
|
130
|
+
gllm_inference_binary-0.5.46.dist-info/METADATA,sha256=e97z4bJANZaeXxjyXY_wSvyxm-n7WbAOCXkCnRbcSYY,5945
|
|
131
|
+
gllm_inference_binary-0.5.46.dist-info/WHEEL,sha256=O_u6PJIQ2pIcyIInxVQ9r-yArMuUZbBIaF1kpYVkYxA,96
|
|
132
|
+
gllm_inference_binary-0.5.46.dist-info/top_level.txt,sha256=FpOjtN80F-qVNgbScXSEyqa0w09FYn6301iq6qt69IQ,15
|
|
133
|
+
gllm_inference_binary-0.5.46.dist-info/RECORD,,
|
|
File without changes
|
{gllm_inference_binary-0.5.44.dist-info → gllm_inference_binary-0.5.46.dist-info}/top_level.txt
RENAMED
|
File without changes
|