TriCacheLLM-MMA 0.1.6__tar.gz → 0.1.7__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.
Files changed (22) hide show
  1. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/PKG-INFO +5 -1
  2. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/README.md +4 -0
  3. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_main.py +44 -1
  4. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA.egg-info/PKG-INFO +5 -1
  5. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/pyproject.toml +1 -1
  6. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/LICENSE +0 -0
  7. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/__init__.py +0 -0
  8. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_Ai/portable_cache_rerankAi.py +0 -0
  9. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_bgWorkers/portable_cache_celery_conf.py +0 -0
  10. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_bgWorkers/portable_cache_workers.py +0 -0
  11. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_dbSchema.py +0 -0
  12. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_redis.py +0 -0
  13. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_schemas/portable_cache_dbBase.py +0 -0
  14. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_schemas/portable_cache_dbConf.py +0 -0
  15. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_schemas/portable_cache_schemas.py +0 -0
  16. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_utils/portable_cache_embedding_model.py +0 -0
  17. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA/portable_cache_utils/protable_cache_DynamicEnv_maker.py +0 -0
  18. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA.egg-info/SOURCES.txt +0 -0
  19. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA.egg-info/dependency_links.txt +0 -0
  20. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA.egg-info/requires.txt +0 -0
  21. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/TriCacheLLM_MMA.egg-info/top_level.txt +0 -0
  22. {tricachellm_mma-0.1.6 → tricachellm_mma-0.1.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TriCacheLLM_MMA
3
- Version: 0.1.6
3
+ Version: 0.1.7
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
6
  License-Expression: LGPL-3.0-only
@@ -521,6 +521,10 @@ app = FastAPI(
521
521
  )
522
522
 
523
523
 
524
+ # NOTE: It is strongly recommended—if not required—to run create_cache_system(user_id=0) for initialization before starting Celery.
525
+ # In upcoming versions, this process will be automated, so you won't need to manually run the Celery command.
526
+
527
+
524
528
  # 1. ADMIN SETUP (Run once on startup / first deploy with user_id=0)
525
529
  @app.post("/api/consumer/init")
526
530
  async def initialize_consumer():
@@ -479,6 +479,10 @@ app = FastAPI(
479
479
  )
480
480
 
481
481
 
482
+ # NOTE: It is strongly recommended—if not required—to run create_cache_system(user_id=0) for initialization before starting Celery.
483
+ # In upcoming versions, this process will be automated, so you won't need to manually run the Celery command.
484
+
485
+
482
486
  # 1. ADMIN SETUP (Run once on startup / first deploy with user_id=0)
483
487
  @app.post("/api/consumer/init")
484
488
  async def initialize_consumer():
@@ -1,7 +1,9 @@
1
1
  # File: portable_cache_main.py
2
2
  import asyncio
3
+ from asyncio import subprocess
3
4
  import hashlib
4
5
  import json
6
+ import os
5
7
  from pathlib import Path
6
8
  from typing import Any
7
9
  from .portable_cache_schemas.portable_cache_dbConf import init_cache_database, init_db_tables, db_manager
@@ -29,6 +31,8 @@ from .portable_cache_redis import get_redis
29
31
  from .portable_cache_redis import redis_manager
30
32
  from .portable_cache_utils.protable_cache_DynamicEnv_maker import system_key
31
33
  from .portable_cache_dbSchema import Paths
34
+ import sys
35
+
32
36
 
33
37
  def create_vector_index_schema(dim: int, distance_metric: str = "COSINE", m: int = 16, ef_construction: int = 200, ef_runtime: int = 10) -> list:
34
38
  return [
@@ -439,10 +443,49 @@ async def create_cache_system(
439
443
  if not key_res["success"]:
440
444
  raise ValueError("Failed to initialize system keys. Verify if the keys are correct.")
441
445
 
446
+
447
+ # This bit is for 0.1.8 (it being after sysetm_key is on purpose)
448
+ """
449
+ is_in_venv = sys.prefix != sys.base_prefix
450
+ celery_name = "celery.exe" if os.name == "nt" else "celery"
451
+ celery_executable = Path(sys.executable).parent / celery_name
452
+
453
+ if is_in_venv and celery_executable.exists():
454
+ celery_cmd = [
455
+ str(celery_executable),
456
+ "-A",
457
+ "TriCacheLLM_MMA.portable_cache_bgWorkers.portable_cache_celery_conf.celery_app",
458
+ "worker",
459
+ "--loglevel=info",
460
+ "-Q",
461
+ "ai"
462
+ ]
463
+
464
+ # Check OS and launch accordingly
465
+ if os.name == "nt":
466
+ subprocess.Popen(celery_cmd, creationflags=subprocess.CREATE_NEW_CONSOLE)
467
+ print("Don't worry, TriCacheLLM_MMA is running celery background workers automatically")
468
+
469
+ elif sys.platform == "darwin":
470
+ try:
471
+ cmd_str = " ".join(celery_cmd)
472
+ subprocess.Popen(["osascript", "-e", f'tell application "Terminal" to do script "{cmd_str}"'])
473
+ print("Don't worry, TriCacheLLM_MMA is running celery background workers automatically")
474
+ except Exception:
475
+ subprocess.Popen(celery_cmd)
476
+ print("Don't worry, TriCacheLLM_MMA is running celery background workers automatically")
477
+ else:
478
+ # Linux / Unix fallback (runs as a background child process)
479
+ subprocess.Popen(celery_cmd)
480
+ print("Don't worry, TriCacheLLM_MMA is running celery background workers automatically")
481
+ else:
482
+ print("---WARNING--- auto celery start failed manually run this command:\ncelery -A TriCacheLLM_MMA.portable_cache_bgWorkers.portable_cache_celery_conf.celery_app worker --loglevel=info -Q ai")
483
+
484
+ """
485
+
442
486
  return #user_id=0 doesnt need its own vdb! if you want to be it user-self be user_id=1 -> single user
443
487
  #if you want multi-tanent then keep sending in user_ids lol
444
488
 
445
-
446
489
  async with db_manager.async_session() as db:
447
490
  ans: None | dict = await create_cache_vdb_inishiator(user_id=user_id, db=db)
448
491
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TriCacheLLM_MMA
3
- Version: 0.1.6
3
+ Version: 0.1.7
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
6
  License-Expression: LGPL-3.0-only
@@ -521,6 +521,10 @@ app = FastAPI(
521
521
  )
522
522
 
523
523
 
524
+ # NOTE: It is strongly recommended—if not required—to run create_cache_system(user_id=0) for initialization before starting Celery.
525
+ # In upcoming versions, this process will be automated, so you won't need to manually run the Celery command.
526
+
527
+
524
528
  # 1. ADMIN SETUP (Run once on startup / first deploy with user_id=0)
525
529
  @app.post("/api/consumer/init")
526
530
  async def initialize_consumer():
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "TriCacheLLM_MMA"
7
- version = "0.1.6"
7
+ version = "0.1.7"
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"
File without changes