gllm-inference-binary 0.5.49__cp311-cp311-manylinux_2_31_x86_64.whl → 0.5.51__cp311-cp311-manylinux_2_31_x86_64.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.

@@ -0,0 +1,28 @@
1
+ from _typeshed import Incomplete
2
+ from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
3
+ from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
4
+ from gllm_inference.schema.model_id import ModelId as ModelId, ModelProvider as ModelProvider, PROVIDERS_OPTIONAL_PATH as PROVIDERS_OPTIONAL_PATH
5
+
6
+ logger: Incomplete
7
+
8
+ class Key:
9
+ """Defines valid keys in the config."""
10
+ ACCESS_KEY_ID: str
11
+ API_KEY: str
12
+ AZURE_DEPLOYMENT: str
13
+ AZURE_ENDPOINT: str
14
+ BASE_URL: str
15
+ CONFIG: str
16
+ CUSTOM_HOST: str
17
+ CREDENTIALS_PATH: str
18
+ MODEL_ID: str
19
+ MODEL_KWARGS: str
20
+ MODEL_NAME: str
21
+ MODEL_CLASS_PATH: str
22
+ PORTKEY_API_KEY: str
23
+ PROVIDER: str
24
+ SECRET_ACCESS_KEY: str
25
+
26
+ PROVIDERS_REQUIRE_BASE_URL: Incomplete
27
+ MODEL_NAME_KEY_MAP: Incomplete
28
+ DEFAULT_MODEL_NAME_KEY: Incomplete
@@ -1,24 +1,9 @@
1
- from _typeshed import Incomplete
2
1
  from gllm_inference.em_invoker import AzureOpenAIEMInvoker as AzureOpenAIEMInvoker, BedrockEMInvoker as BedrockEMInvoker, CohereEMInvoker as CohereEMInvoker, GoogleEMInvoker as GoogleEMInvoker, JinaEMInvoker as JinaEMInvoker, LangChainEMInvoker as LangChainEMInvoker, OpenAICompatibleEMInvoker as OpenAICompatibleEMInvoker, OpenAIEMInvoker as OpenAIEMInvoker, TwelveLabsEMInvoker as TwelveLabsEMInvoker, VoyageEMInvoker as VoyageEMInvoker
3
2
  from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
4
- from gllm_inference.schema.model_id import ModelId as ModelId, ModelProvider as ModelProvider, OPTIONAL_PATH_PROVIDERS as OPTIONAL_PATH_PROVIDERS
3
+ from gllm_inference.schema.model_id import ModelId as ModelId, ModelProvider as ModelProvider
5
4
  from typing import Any
6
5
 
7
6
  PROVIDER_TO_EM_INVOKER_MAP: dict[str, type[BaseEMInvoker]]
8
- logger: Incomplete
9
-
10
- class Key:
11
- """Defines valid keys in the config."""
12
- ACCESS_KEY_ID: str
13
- API_KEY: str
14
- AZURE_DEPLOYMENT: str
15
- AZURE_ENDPOINT: str
16
- BASE_URL: str
17
- CREDENTIALS_PATH: str
18
- MODEL_KWARGS: str
19
- MODEL_NAME: str
20
- MODEL_CLASS_PATH: str
21
- SECRET_ACCESS_KEY: str
22
7
 
23
8
  def build_em_invoker(model_id: str | ModelId, credentials: str | dict[str, Any] | None = None, config: dict[str, Any] | None = None) -> BaseEMInvoker:
24
9
  '''Build an embedding model invoker based on the provided configurations.
@@ -1,29 +1,9 @@
1
- from _typeshed import Incomplete
2
1
  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
2
  from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker as BaseLMInvoker
4
3
  from gllm_inference.schema.model_id import ModelId as ModelId, ModelProvider as ModelProvider
5
4
  from typing import Any
6
5
 
7
6
  PROVIDER_TO_LM_INVOKER_MAP: dict[str, type[BaseLMInvoker]]
8
- logger: Incomplete
9
-
10
- class Key:
11
- """Defines valid keys in the config."""
12
- ACCESS_KEY_ID: str
13
- API_KEY: str
14
- AZURE_DEPLOYMENT: str
15
- AZURE_ENDPOINT: str
16
- BASE_URL: str
17
- CONFIG: str
18
- CUSTOM_HOST: str
19
- CREDENTIALS_PATH: str
20
- MODEL_ID: str
21
- MODEL_KWARGS: str
22
- MODEL_NAME: str
23
- MODEL_CLASS_PATH: str
24
- PORTKEY_API_KEY: str
25
- PROVIDER: str
26
- SECRET_ACCESS_KEY: str
27
7
 
28
8
  def build_lm_invoker(model_id: str | ModelId, credentials: str | dict[str, Any] | None = None, config: dict[str, Any] | None = None) -> BaseLMInvoker:
29
9
  '''Build a language model invoker based on the provided configurations.
@@ -5,12 +5,13 @@ from gllm_inference.em_invoker.em_invoker import BaseEMInvoker as BaseEMInvoker
5
5
  from gllm_inference.em_invoker.schema.bedrock import InputType as InputType, Key as Key, OutputType as OutputType
6
6
  from gllm_inference.exceptions import BaseInvokerError as BaseInvokerError, convert_http_status_to_base_invoker_error as convert_http_status_to_base_invoker_error
7
7
  from gllm_inference.exceptions.provider_error_map import BEDROCK_ERROR_MAPPING as BEDROCK_ERROR_MAPPING
8
- from gllm_inference.schema import ModelId as ModelId, ModelProvider as ModelProvider, TruncationConfig as TruncationConfig, Vector as Vector
8
+ from gllm_inference.schema import Attachment as Attachment, AttachmentType as AttachmentType, EMContent as EMContent, ModelId as ModelId, ModelProvider as ModelProvider, TruncationConfig as TruncationConfig, Vector as Vector
9
9
  from typing import Any
10
10
 
11
11
  class ModelType(StrEnum):
12
12
  """Defines the type of the Bedrock embedding model."""
13
13
  COHERE = 'cohere'
14
+ MARENGO = 'marengo'
14
15
  TITAN = 'titan'
15
16
 
16
17
  SUPPORTED_ATTACHMENTS: Incomplete
@@ -29,12 +30,14 @@ class BedrockEMInvoker(BaseEMInvoker):
29
30
  truncation_config (TruncationConfig | None): The truncation configuration for the embedding model.
30
31
 
31
32
  Input types:
32
- The `BedrockEMInvoker` only supports text inputs.
33
+ The `BedrockEMInvoker` supports:
34
+ 1. Text inputs for Cohere, Titan, and Marengo models
35
+ 2. Image inputs for Marengo models through Attachment objects
33
36
 
34
37
  Output format:
35
38
  The `BedrockEMInvoker` can embed either:
36
39
  1. A single content.
37
- 1. A single content is a single text.
40
+ 1. A single content is a single text or single image (image only supported for Marengo).
38
41
  2. The output will be a `Vector`, representing the embedding of the content.
39
42
 
40
43
  # Example 1: Embedding a text content.
@@ -43,10 +46,19 @@ class BedrockEMInvoker(BaseEMInvoker):
43
46
  result = await em_invoker.invoke(text)
44
47
  ```
45
48
 
49
+ # Example 2: Embedding an image with Marengo.
50
+ ```python
51
+ em_invoker = BedrockEMInvoker(
52
+ model_name="us.twelvelabs.marengo-2.7"
53
+ )
54
+ image = Attachment.from_path("path/to/local/image.png")
55
+ result = await em_invoker.invoke(image)
56
+ ```
57
+
46
58
  The above examples will return a `Vector` with a size of (embedding_size,).
47
59
 
48
60
  2. A list of contents.
49
- 1. A list of contents is a list of texts.
61
+ 1. A list of contents is a list of texts or images (images only supported for Marengo).
50
62
  2. The output will be a `list[Vector]`, where each element is a `Vector` representing the
51
63
  embedding of each single content.
52
64
 
@@ -1,22 +1,29 @@
1
1
  class Key:
2
2
  """Defines valid keys in Bedrock."""
3
3
  ACCEPT: str
4
+ BASE64_STRING: str
4
5
  CONTENT_TYPE: str
5
6
  HTTP_STATUS_CODE: str
6
7
  INPUT_TEXT: str
7
8
  INPUT_TYPE: str
9
+ INPUT_TYPE_MARENGO: str
10
+ MEDIA_SOURCE: str
8
11
  MODEL_ID: str
9
12
  RESPONSE_METADATA: str
13
+ TEXT_TRUNCATE: str
10
14
  TEXTS: str
11
15
 
12
16
  class InputType:
13
17
  """Defines valid input types in Bedrock."""
14
18
  APPLICATION_JSON: str
19
+ IMAGE: str
15
20
  SEARCH_DOCUMENT: str
16
21
  SEARCH_QUERY: str
22
+ TEXT: str
17
23
 
18
24
  class OutputType:
19
25
  """Defines valid output types in Bedrock."""
20
26
  BODY: str
27
+ DATA: str
21
28
  EMBEDDING: str
22
29
  EMBEDDINGS: str
@@ -26,8 +26,8 @@ class ModelProvider(StrEnum):
26
26
  VOYAGE = 'voyage'
27
27
  XAI = 'xai'
28
28
 
29
- OPTIONAL_PATH_PROVIDERS: Incomplete
30
- PATH_SUPPORTING_PROVIDERS: Incomplete
29
+ PROVIDERS_OPTIONAL_PATH: Incomplete
30
+ PROVIDERS_SUPPORT_PATH: Incomplete
31
31
 
32
32
  class ModelId(BaseModel):
33
33
  '''Defines a representation of a valid model id.
@@ -53,6 +53,11 @@ class ModelId(BaseModel):
53
53
  model_id = ModelId.from_string("cohere/embed-english-v3.0")
54
54
  ```
55
55
 
56
+ # Using Cohere with custom endpoint
57
+ ```python
58
+ model_id = ModelId.from_string("cohere/https://my-cohere-url:8000/v1:my-model-name")
59
+ ```
60
+
56
61
  # Using Datasaur
57
62
  ```python
58
63
  model_id = ModelId.from_string("datasaur/https://deployment.datasaur.ai/api/deployment/teamId/deploymentId/")
@@ -67,8 +72,11 @@ class ModelId(BaseModel):
67
72
  ```python
68
73
  model_id = ModelId.from_string("jina/jina-embeddings-v2-large")
69
74
  ```
70
- For the list of supported models, please refer to the following page:
71
- https://jina.ai/models
75
+
76
+ # Using Jina with custom endpoint
77
+ ```python
78
+ model_id = ModelId.from_string("jina/https://my-jina-url:8000/v1:my-model-name")
79
+ ```
72
80
 
73
81
  # Using OpenAI
74
82
  ```python
gllm_inference.pyi CHANGED
@@ -48,15 +48,15 @@ import gllm_inference.schema.ModelId
48
48
  import gllm_inference.schema.ModelProvider
49
49
  import gllm_inference.schema.TruncationConfig
50
50
  import asyncio
51
+ import base64
51
52
  import enum
52
53
  import gllm_inference.exceptions.BaseInvokerError
53
54
  import gllm_inference.exceptions.convert_http_status_to_base_invoker_error
54
- import gllm_inference.schema.Vector
55
- import aioboto3
56
- import base64
57
55
  import gllm_inference.schema.Attachment
58
56
  import gllm_inference.schema.AttachmentType
59
57
  import gllm_inference.schema.EMContent
58
+ import gllm_inference.schema.Vector
59
+ import aioboto3
60
60
  import gllm_inference.utils.validate_string_enum
61
61
  import cohere
62
62
  import asyncio.CancelledError
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gllm-inference-binary
3
- Version: 0.5.49
3
+ Version: 0.5.51
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
@@ -1,10 +1,11 @@
1
- gllm_inference.cpython-311-x86_64-linux-gnu.so,sha256=QDq0TPi3XApE83OWIXy3IzHmzkiK6h92mhyzhnmC0hU,5283024
2
- gllm_inference.pyi,sha256=B-sC5mJR6Fp9xIJIf0D3JL5VLFlc3ACmMJN7Zkc6gb4,5191
1
+ gllm_inference.cpython-311-x86_64-linux-gnu.so,sha256=qVffjaYR4GZH2cgvXEKtcTuslJFkS6lNESQa9DcOmjw,5291280
2
+ gllm_inference.pyi,sha256=9EID8MhTbq9wGizE04ZelJSAUmiza8WdfCTqhQj3dAE,5191
3
3
  gllm_inference/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  gllm_inference/constants.pyi,sha256=viU-ACRbVSGvsCJ0FQmuR1yhyl-BzoHDVIWo5cwHmF0,337
5
5
  gllm_inference/builder/__init__.pyi,sha256=usz2lvfwO4Yk-ZGKXbCWG1cEr3nlQXxMNDNC-2yc1NM,500
6
- gllm_inference/builder/build_em_invoker.pyi,sha256=YunCB3g7gRSYVDRayjz38QCw77_el2e-0iqdOH6KS1Y,6138
7
- gllm_inference/builder/build_lm_invoker.pyi,sha256=NRSk4EqTNv_trja71HUnl52NQNP0khaOZeTKlknEG94,9287
6
+ gllm_inference/builder/_build_invoker.pyi,sha256=v__-YT0jGmLqEsgl7Abk9we-wYWcyVFvlRN_Uu4vVak,848
7
+ gllm_inference/builder/build_em_invoker.pyi,sha256=0IVcRGaciPBAFcgvGRC4-Kje_PPXOSug77LqxRc-x_U,5749
8
+ gllm_inference/builder/build_lm_invoker.pyi,sha256=TBAr7Sk9Jgckdlfj69pYOzZFMsooL-FpfbPYt_kCcXU,8852
8
9
  gllm_inference/builder/build_lm_request_processor.pyi,sha256=KbQkcPa8C-yzyelht4mWLP8kDmh17itAT3tn8ZJB6pg,4144
9
10
  gllm_inference/builder/build_output_parser.pyi,sha256=_Lrq-bh1oPsb_Nwkkr_zyEUwIOMysRFZkvEtEM29LZM,936
10
11
  gllm_inference/catalog/__init__.pyi,sha256=JBkPGTyiiZ30GECzJBW-mW8LekWyY2qyzal3eW7ynaM,287
@@ -13,7 +14,7 @@ gllm_inference/catalog/lm_request_processor_catalog.pyi,sha256=WW1j8jWujnatF0c9r
13
14
  gllm_inference/catalog/prompt_builder_catalog.pyi,sha256=OU8k_4HbqjZEzHZlzSM3uzGQZJmM2uGD76Csqom0CEQ,3197
14
15
  gllm_inference/em_invoker/__init__.pyi,sha256=FHFR4k8RqtdMNZkda6A89tvWFtIoxF-t_NahDGeBQ2k,1199
15
16
  gllm_inference/em_invoker/azure_openai_em_invoker.pyi,sha256=fE-RZ10Leerbyqp8ISXeqdU_m0kaHdlHml_nQqwFjqY,4961
16
- gllm_inference/em_invoker/bedrock_em_invoker.pyi,sha256=hbKdar6Alu27gOPPASND1ptJIK1PPmj7NjgKwItnOgo,5725
17
+ gllm_inference/em_invoker/bedrock_em_invoker.pyi,sha256=3GkVO9hvmYck4NJY5spAg6opSxr0v8OJ4qhMvz1rcAA,6365
17
18
  gllm_inference/em_invoker/cohere_em_invoker.pyi,sha256=LSNVGx58JdSP2YB6CziOS_v5VuSLdARVpBBWhz8t5E4,6665
18
19
  gllm_inference/em_invoker/em_invoker.pyi,sha256=KGjLiAWGIA3ziV50zMwSzx6lTVUbYspQCl4LFxqbDlY,5101
19
20
  gllm_inference/em_invoker/google_em_invoker.pyi,sha256=OgIQhT2g6g09Hqr9mc2--MjV3Ti-XuHfqLTunvcqU1k,6824
@@ -26,7 +27,7 @@ gllm_inference/em_invoker/voyage_em_invoker.pyi,sha256=gyYQA3rbekHJIvvY6TE4tTt8W
26
27
  gllm_inference/em_invoker/langchain/__init__.pyi,sha256=VYGKE5OgU0my1RlhgzkU_A7-GLGnUDDnNFuctuRwILE,148
27
28
  gllm_inference/em_invoker/langchain/em_invoker_embeddings.pyi,sha256=VU3-Vhb9BCDhJo8PPdWHe2rBEOCs_HMXT6ZaWwjUzZE,3304
28
29
  gllm_inference/em_invoker/schema/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- gllm_inference/em_invoker/schema/bedrock.pyi,sha256=AHFW8uYOTS7RtqV1RmtY-XQK1xpMgsHxWg4RZhVgI_8,476
30
+ gllm_inference/em_invoker/schema/bedrock.pyi,sha256=ePYwailnZAYbZKt9HRDi4iAISq003jpxQPxDCiFdEZg,615
30
31
  gllm_inference/em_invoker/schema/cohere.pyi,sha256=UTbTtePRR1zJMsM09SiTZSZZP0IaUGaODvc7ZqH9S8c,547
31
32
  gllm_inference/em_invoker/schema/google.pyi,sha256=ovDlvinu99QJhIxMkvVUoGBEFkkEoAZhadSuk0nI9N8,181
32
33
  gllm_inference/em_invoker/schema/jina.pyi,sha256=vE1ySd8OTDM35saEZos7UCdPwHeX66iuHkZ3RchSZKA,741
@@ -119,7 +120,7 @@ gllm_inference/schema/lm_input.pyi,sha256=A5pjz1id6tP9XRNhzQrbmzd66C_q3gzo0UP8rC
119
120
  gllm_inference/schema/lm_output.pyi,sha256=1SZi6vIWvmrZlVQ59WeQUKO5VhKrLHsSRDYslEH9d7o,2435
120
121
  gllm_inference/schema/mcp.pyi,sha256=Vwu8E2BDl6FvvnI42gIyY3Oki1BdwRE3Uh3aV0rmhQU,1014
121
122
  gllm_inference/schema/message.pyi,sha256=VP9YppKj2mo1esl9cy6qQO9m2mMHUjTmfGDdyUor880,2220
122
- gllm_inference/schema/model_id.pyi,sha256=U2hiFraeO_occF0Wk3Wn0zTo7sUCwz1_C42ns5sP7Ek,5676
123
+ gllm_inference/schema/model_id.pyi,sha256=BHzi8PdYsV_rPGkBcKvZJDCf62ToPjmRTcXcTgKfoTg,5894
123
124
  gllm_inference/schema/reasoning.pyi,sha256=SlTuiDw87GdnAn-I6YOPIJRhEBiwQljM46JohG05guQ,562
124
125
  gllm_inference/schema/token_usage.pyi,sha256=1GTQVORV0dBNmD_jix8aVaUqxMKFF04KpLP7y2urqbk,2950
125
126
  gllm_inference/schema/tool_call.pyi,sha256=zQaVxCnkVxOfOEhBidqohU85gb4PRwnwBiygKaunamk,389
@@ -130,7 +131,7 @@ gllm_inference/utils/io_utils.pyi,sha256=7kUTacHAVRYoemFUOjCH7-Qmw-YsQGd6rGYxjf_
130
131
  gllm_inference/utils/langchain.pyi,sha256=VluQiHkGigDdqLUbhB6vnXiISCP5hHqV0qokYY6dC1A,1164
131
132
  gllm_inference/utils/validation.pyi,sha256=toxBtRp-VItC_X7sNi-GDd7sjibBdWMrR0q01OI2D7k,385
132
133
  gllm_inference.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
133
- gllm_inference_binary-0.5.49.dist-info/METADATA,sha256=ZPlydy4f8zv2Aohcfzfd6IhDI8szJzDzX9ZLH7ckhb4,5807
134
- gllm_inference_binary-0.5.49.dist-info/WHEEL,sha256=WMelAR6z66VnlU3tu68fV-jM5qbG8iPyeTqaBcpU3pI,108
135
- gllm_inference_binary-0.5.49.dist-info/top_level.txt,sha256=FpOjtN80F-qVNgbScXSEyqa0w09FYn6301iq6qt69IQ,15
136
- gllm_inference_binary-0.5.49.dist-info/RECORD,,
134
+ gllm_inference_binary-0.5.51.dist-info/METADATA,sha256=YQnVAdpLS6fRZZZl0v0qP-JRRbB6axvOCNyF8LbgVtM,5807
135
+ gllm_inference_binary-0.5.51.dist-info/WHEEL,sha256=WMelAR6z66VnlU3tu68fV-jM5qbG8iPyeTqaBcpU3pI,108
136
+ gllm_inference_binary-0.5.51.dist-info/top_level.txt,sha256=FpOjtN80F-qVNgbScXSEyqa0w09FYn6301iq6qt69IQ,15
137
+ gllm_inference_binary-0.5.51.dist-info/RECORD,,