ragbits-core 1.4.0.dev202512030235__py3-none-any.whl → 1.4.0.dev202512050236__py3-none-any.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.
- ragbits/core/llms/litellm.py +9 -1
- {ragbits_core-1.4.0.dev202512030235.dist-info → ragbits_core-1.4.0.dev202512050236.dist-info}/METADATA +1 -1
- {ragbits_core-1.4.0.dev202512030235.dist-info → ragbits_core-1.4.0.dev202512050236.dist-info}/RECORD +4 -4
- {ragbits_core-1.4.0.dev202512030235.dist-info → ragbits_core-1.4.0.dev202512050236.dist-info}/WHEEL +0 -0
ragbits/core/llms/litellm.py
CHANGED
|
@@ -102,6 +102,7 @@ class LiteLLM(LLM[LiteLLMOptions], LazyLiteLLM):
|
|
|
102
102
|
self.use_structured_output = use_structured_output
|
|
103
103
|
self.router = router
|
|
104
104
|
self.custom_model_cost_config = custom_model_cost_config
|
|
105
|
+
self._cached_router: Router | None = None # Cache for auto-created router
|
|
105
106
|
if custom_model_cost_config:
|
|
106
107
|
self._litellm.register_model(custom_model_cost_config)
|
|
107
108
|
|
|
@@ -434,7 +435,14 @@ class LiteLLM(LLM[LiteLLMOptions], LazyLiteLLM):
|
|
|
434
435
|
stream: bool = False,
|
|
435
436
|
stream_options: dict | None = None,
|
|
436
437
|
) -> "ModelResponse | CustomStreamWrapper":
|
|
437
|
-
|
|
438
|
+
# Use provided router, or create/reuse cached router
|
|
439
|
+
if self.router:
|
|
440
|
+
entrypoint = self.router
|
|
441
|
+
else:
|
|
442
|
+
# Create router only once and cache it to avoid callback leak
|
|
443
|
+
if self._cached_router is None:
|
|
444
|
+
self._cached_router = self._create_router_from_self_and_options(options)
|
|
445
|
+
entrypoint = self._cached_router
|
|
438
446
|
|
|
439
447
|
# Preprocess messages for Claude with reasoning enabled
|
|
440
448
|
processed_conversation = self._preprocess_messages_for_claude(conversation, options)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ragbits-core
|
|
3
|
-
Version: 1.4.0.
|
|
3
|
+
Version: 1.4.0.dev202512050236
|
|
4
4
|
Summary: Building blocks for rapid development of GenAI applications
|
|
5
5
|
Project-URL: Homepage, https://github.com/deepsense-ai/ragbits
|
|
6
6
|
Project-URL: Bug Reports, https://github.com/deepsense-ai/ragbits/issues
|
{ragbits_core-1.4.0.dev202512030235.dist-info → ragbits_core-1.4.0.dev202512050236.dist-info}/RECORD
RENAMED
|
@@ -32,7 +32,7 @@ ragbits/core/llms/__init__.py,sha256=-XI2zHa-xt3EoQbgqMud_GCVZxBCQXGDMY62AAOOAGA
|
|
|
32
32
|
ragbits/core/llms/base.py,sha256=CXAreuEzQ2BhmQw44Oud-OyguEXDbfxa1Ckog3ZLHc0,28295
|
|
33
33
|
ragbits/core/llms/exceptions.py,sha256=NpYYAhCMifHNDFWQpshjF9in_KCEmo6qlswPJca9ykc,2301
|
|
34
34
|
ragbits/core/llms/factory.py,sha256=T-heeY_7Llp5bOl6u9ycKK8ZwFnUE1ry4Q4X-O68hEQ,1506
|
|
35
|
-
ragbits/core/llms/litellm.py,sha256=
|
|
35
|
+
ragbits/core/llms/litellm.py,sha256=KxsmL2gEvRaSrMuDCRYF4tBLOfLnxuzjy2PCElgl6x0,26272
|
|
36
36
|
ragbits/core/llms/local.py,sha256=B5woo538621mv6SJ9FosW3LcDBtmAA8gycMe4EvHbzE,11760
|
|
37
37
|
ragbits/core/llms/mock.py,sha256=CebF0kpvVvluqRdj1HtXM3GoCKq_VQLcud5dvUFQNYs,5053
|
|
38
38
|
ragbits/core/prompt/__init__.py,sha256=2e71_O4RreG1gfdN9KXSscbOvr5DKzqiDu4J8LTD9Bs,120
|
|
@@ -74,6 +74,6 @@ ragbits/core/vector_stores/in_memory.py,sha256=igxIYmTSXOijYFsPolo5sbYzSgLBwF5Lt
|
|
|
74
74
|
ragbits/core/vector_stores/pgvector.py,sha256=_XPPfOsxiWkk6-ISLbrLRXw5sjcXizEA2Q_-YlqU7DQ,19944
|
|
75
75
|
ragbits/core/vector_stores/qdrant.py,sha256=7M41efCtD5dkJeWtPY8P62zdM6F6IDU72mlxlwTg6Zk,12817
|
|
76
76
|
ragbits/core/vector_stores/weaviate.py,sha256=Xfa9tDEEILuD7EMhk2vWPC_fewJqe1YXaNtPxnD59Ys,18989
|
|
77
|
-
ragbits_core-1.4.0.
|
|
78
|
-
ragbits_core-1.4.0.
|
|
79
|
-
ragbits_core-1.4.0.
|
|
77
|
+
ragbits_core-1.4.0.dev202512050236.dist-info/METADATA,sha256=7TLH-az6HeRdp2-EKX3Amn-rYHvV5eDdAuxXd4debPo,5193
|
|
78
|
+
ragbits_core-1.4.0.dev202512050236.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
79
|
+
ragbits_core-1.4.0.dev202512050236.dist-info/RECORD,,
|
{ragbits_core-1.4.0.dev202512030235.dist-info → ragbits_core-1.4.0.dev202512050236.dist-info}/WHEEL
RENAMED
|
File without changes
|