TriCacheLLM-MMA 0.1.3__tar.gz → 0.1.5__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.
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/PKG-INFO +23 -8
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/README.md +21 -7
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_utils/portable_cache_embedding_model.py +2 -1
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA.egg-info/PKG-INFO +23 -8
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/pyproject.toml +3 -1
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/LICENSE +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/__init__.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_Ai/portable_cache_rerankAi.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_bgWorkers/portable_cache_celery_conf.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_bgWorkers/portable_cache_workers.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_dbSchema.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_main.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_redis.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_schemas/portable_cache_dbBase.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_schemas/portable_cache_dbConf.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_schemas/portable_cache_schemas.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA/portable_cache_utils/protable_cache_DynamicEnv_maker.py +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA.egg-info/SOURCES.txt +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA.egg-info/dependency_links.txt +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA.egg-info/requires.txt +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA.egg-info/top_level.txt +0 -0
- {tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/setup.cfg +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TriCacheLLM_MMA
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: A robust three-tier LLM-aware caching SDK using Redis, ChromaDB, and automatic SQLite bootstrap.
|
|
5
5
|
Author-email: Mohib Ashfaq Butt <inboxmohib@gmail.com>
|
|
6
|
+
License-Expression: LGPL-3.0-only
|
|
6
7
|
Project-URL: Homepage, https://github.com/mohib-ash/TriCacheLLM_MMA
|
|
7
8
|
Project-URL: Repository, https://github.com/mohib-ash/TriCacheLLM_MMA
|
|
8
9
|
Project-URL: Issues, https://github.com/mohib-ash/TriCacheLLM_MMA/issues
|
|
@@ -510,18 +511,31 @@ from TriCacheLLM_MMA import (
|
|
|
510
511
|
check_tenant_creation_status,
|
|
511
512
|
)
|
|
512
513
|
|
|
513
|
-
|
|
514
|
+
|
|
515
|
+
@asynccontextmanager
|
|
516
|
+
async def lifespan(app: FastAPI):
|
|
517
|
+
yield
|
|
518
|
+
await close_cache_system()
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
app = FastAPI(
|
|
522
|
+
title="TriCacheLLM_MMA V1 Route Test",
|
|
523
|
+
lifespan=lifespan,
|
|
524
|
+
)
|
|
525
|
+
|
|
514
526
|
|
|
515
527
|
# 1. ADMIN SETUP (Run once on startup / first deploy with user_id=0)
|
|
516
|
-
@app.
|
|
517
|
-
async def
|
|
518
|
-
|
|
528
|
+
@app.post("/api/consumer/init")
|
|
529
|
+
async def initialize_consumer():
|
|
530
|
+
user_id: int = 0
|
|
531
|
+
result = await create_cache_system(
|
|
519
532
|
redis_url="redis://localhost:6379/0",
|
|
520
|
-
cohere_api_key="
|
|
533
|
+
cohere_api_key="KEY_HERE",
|
|
521
534
|
chroma_db_dir="./chroma_db",
|
|
522
535
|
db_path="./cache.db",
|
|
523
|
-
user_id=
|
|
536
|
+
user_id=user_id,
|
|
524
537
|
)
|
|
538
|
+
return {"status": "success", "details": result}
|
|
525
539
|
|
|
526
540
|
|
|
527
541
|
# 2. TENANT ENDPOINT (Zero boilerplate for subsequent users)
|
|
@@ -551,12 +565,13 @@ async def ask_question(
|
|
|
551
565
|
)
|
|
552
566
|
|
|
553
567
|
return {"source": "ai", "response": llm_response}
|
|
568
|
+
|
|
554
569
|
```
|
|
555
570
|
The core cache operations are asynchronous Python APIs and are not inherently tied to FastAPI.
|
|
556
571
|
The included integration example uses FastAPI because it provides a convenient demonstration of multi-user request handling.
|
|
557
572
|
|
|
558
573
|
V1 is primarily demonstrated in a web-service architecture, while future versions aim to make standalone application integration equally straightforward.
|
|
559
|
-
***NOTE:
|
|
574
|
+
***NOTE: On first initialization, the embedding model may contact Hugging Face to obtain the model if it is not already available in the local cache. Subsequent process reloads and reuse the locally cached model files Blazing fast.***
|
|
560
575
|
|
|
561
576
|
---
|
|
562
577
|
|
|
@@ -469,18 +469,31 @@ from TriCacheLLM_MMA import (
|
|
|
469
469
|
check_tenant_creation_status,
|
|
470
470
|
)
|
|
471
471
|
|
|
472
|
-
|
|
472
|
+
|
|
473
|
+
@asynccontextmanager
|
|
474
|
+
async def lifespan(app: FastAPI):
|
|
475
|
+
yield
|
|
476
|
+
await close_cache_system()
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
app = FastAPI(
|
|
480
|
+
title="TriCacheLLM_MMA V1 Route Test",
|
|
481
|
+
lifespan=lifespan,
|
|
482
|
+
)
|
|
483
|
+
|
|
473
484
|
|
|
474
485
|
# 1. ADMIN SETUP (Run once on startup / first deploy with user_id=0)
|
|
475
|
-
@app.
|
|
476
|
-
async def
|
|
477
|
-
|
|
486
|
+
@app.post("/api/consumer/init")
|
|
487
|
+
async def initialize_consumer():
|
|
488
|
+
user_id: int = 0
|
|
489
|
+
result = await create_cache_system(
|
|
478
490
|
redis_url="redis://localhost:6379/0",
|
|
479
|
-
cohere_api_key="
|
|
491
|
+
cohere_api_key="KEY_HERE",
|
|
480
492
|
chroma_db_dir="./chroma_db",
|
|
481
493
|
db_path="./cache.db",
|
|
482
|
-
user_id=
|
|
494
|
+
user_id=user_id,
|
|
483
495
|
)
|
|
496
|
+
return {"status": "success", "details": result}
|
|
484
497
|
|
|
485
498
|
|
|
486
499
|
# 2. TENANT ENDPOINT (Zero boilerplate for subsequent users)
|
|
@@ -510,12 +523,13 @@ async def ask_question(
|
|
|
510
523
|
)
|
|
511
524
|
|
|
512
525
|
return {"source": "ai", "response": llm_response}
|
|
526
|
+
|
|
513
527
|
```
|
|
514
528
|
The core cache operations are asynchronous Python APIs and are not inherently tied to FastAPI.
|
|
515
529
|
The included integration example uses FastAPI because it provides a convenient demonstration of multi-user request handling.
|
|
516
530
|
|
|
517
531
|
V1 is primarily demonstrated in a web-service architecture, while future versions aim to make standalone application integration equally straightforward.
|
|
518
|
-
***NOTE:
|
|
532
|
+
***NOTE: On first initialization, the embedding model may contact Hugging Face to obtain the model if it is not already available in the local cache. Subsequent process reloads and reuse the locally cached model files Blazing fast.***
|
|
519
533
|
|
|
520
534
|
---
|
|
521
535
|
|
|
@@ -3,5 +3,6 @@ from langchain_huggingface import HuggingFaceEmbeddings
|
|
|
3
3
|
from ..portable_cache_utils.protable_cache_DynamicEnv_maker import get_settings
|
|
4
4
|
|
|
5
5
|
embedding_model = HuggingFaceEmbeddings(
|
|
6
|
-
model_name=get_settings().portable_cache_cache_proj_embedding_model
|
|
6
|
+
model_name=get_settings().portable_cache_cache_proj_embedding_model,
|
|
7
|
+
cache_folder=get_settings().portable_cache_chroma_db_dir
|
|
7
8
|
)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TriCacheLLM_MMA
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: A robust three-tier LLM-aware caching SDK using Redis, ChromaDB, and automatic SQLite bootstrap.
|
|
5
5
|
Author-email: Mohib Ashfaq Butt <inboxmohib@gmail.com>
|
|
6
|
+
License-Expression: LGPL-3.0-only
|
|
6
7
|
Project-URL: Homepage, https://github.com/mohib-ash/TriCacheLLM_MMA
|
|
7
8
|
Project-URL: Repository, https://github.com/mohib-ash/TriCacheLLM_MMA
|
|
8
9
|
Project-URL: Issues, https://github.com/mohib-ash/TriCacheLLM_MMA/issues
|
|
@@ -510,18 +511,31 @@ from TriCacheLLM_MMA import (
|
|
|
510
511
|
check_tenant_creation_status,
|
|
511
512
|
)
|
|
512
513
|
|
|
513
|
-
|
|
514
|
+
|
|
515
|
+
@asynccontextmanager
|
|
516
|
+
async def lifespan(app: FastAPI):
|
|
517
|
+
yield
|
|
518
|
+
await close_cache_system()
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
app = FastAPI(
|
|
522
|
+
title="TriCacheLLM_MMA V1 Route Test",
|
|
523
|
+
lifespan=lifespan,
|
|
524
|
+
)
|
|
525
|
+
|
|
514
526
|
|
|
515
527
|
# 1. ADMIN SETUP (Run once on startup / first deploy with user_id=0)
|
|
516
|
-
@app.
|
|
517
|
-
async def
|
|
518
|
-
|
|
528
|
+
@app.post("/api/consumer/init")
|
|
529
|
+
async def initialize_consumer():
|
|
530
|
+
user_id: int = 0
|
|
531
|
+
result = await create_cache_system(
|
|
519
532
|
redis_url="redis://localhost:6379/0",
|
|
520
|
-
cohere_api_key="
|
|
533
|
+
cohere_api_key="KEY_HERE",
|
|
521
534
|
chroma_db_dir="./chroma_db",
|
|
522
535
|
db_path="./cache.db",
|
|
523
|
-
user_id=
|
|
536
|
+
user_id=user_id,
|
|
524
537
|
)
|
|
538
|
+
return {"status": "success", "details": result}
|
|
525
539
|
|
|
526
540
|
|
|
527
541
|
# 2. TENANT ENDPOINT (Zero boilerplate for subsequent users)
|
|
@@ -551,12 +565,13 @@ async def ask_question(
|
|
|
551
565
|
)
|
|
552
566
|
|
|
553
567
|
return {"source": "ai", "response": llm_response}
|
|
568
|
+
|
|
554
569
|
```
|
|
555
570
|
The core cache operations are asynchronous Python APIs and are not inherently tied to FastAPI.
|
|
556
571
|
The included integration example uses FastAPI because it provides a convenient demonstration of multi-user request handling.
|
|
557
572
|
|
|
558
573
|
V1 is primarily demonstrated in a web-service architecture, while future versions aim to make standalone application integration equally straightforward.
|
|
559
|
-
***NOTE:
|
|
574
|
+
***NOTE: On first initialization, the embedding model may contact Hugging Face to obtain the model if it is not already available in the local cache. Subsequent process reloads and reuse the locally cached model files Blazing fast.***
|
|
560
575
|
|
|
561
576
|
---
|
|
562
577
|
|
|
@@ -4,13 +4,15 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "TriCacheLLM_MMA"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
description = "A robust three-tier LLM-aware caching SDK using Redis, ChromaDB, and automatic SQLite bootstrap."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name = "Mohib Ashfaq Butt", email = "inboxmohib@gmail.com" }
|
|
13
13
|
]
|
|
14
|
+
license = "LGPL-3.0-only"
|
|
15
|
+
license-files = ["LICENSE"]
|
|
14
16
|
keywords = [
|
|
15
17
|
"llm",
|
|
16
18
|
"cache",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tricachellm_mma-0.1.3 → tricachellm_mma-0.1.5}/TriCacheLLM_MMA.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|