isa-model 0.4.3__py3-none-any.whl → 0.4.5__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.
isa_model/core/config.py CHANGED
@@ -54,7 +54,7 @@ class LocalGPUGlobalConfig:
54
54
  enable_local_gpu: bool = True
55
55
  auto_detect_gpu: bool = True
56
56
  workspace_dir: str = "./local_deployments"
57
- preferred_backend: str = "transformers" # vllm, tensorrt_llm, transformers
57
+ preferred_backend: str = "api" # cloud api only
58
58
 
59
59
  # Default resource settings
60
60
  default_gpu_memory_fraction: float = 0.9
@@ -114,7 +114,7 @@ class GlobalConfig:
114
114
  local_gpu_memory_fraction: float = 0.9
115
115
  local_workspace_dir: str = "./local_deployments"
116
116
  auto_detect_gpu: bool = True
117
- preferred_local_backend: str = "transformers" # vllm, tensorrt_llm, transformers
117
+ preferred_local_backend: str = "api" # cloud api only
118
118
 
119
119
  # Local service defaults
120
120
  local_health_check_interval: int = 30 # seconds
@@ -263,7 +263,7 @@ class ConfigManager:
263
263
  "enable_local_gpu": os.getenv("ISA_ENABLE_LOCAL_GPU", "true").lower() == "true",
264
264
  "auto_detect_gpu": os.getenv("ISA_AUTO_DETECT_GPU", "true").lower() == "true",
265
265
  "workspace_dir": os.getenv("ISA_LOCAL_WORKSPACE_DIR", "./local_deployments"),
266
- "preferred_backend": os.getenv("ISA_PREFERRED_LOCAL_BACKEND", "transformers"),
266
+ "preferred_backend": os.getenv("ISA_PREFERRED_LOCAL_BACKEND", "api"),
267
267
  "default_gpu_memory_fraction": float(os.getenv("ISA_GPU_MEMORY_FRACTION", "0.9")),
268
268
  "health_check_interval": int(os.getenv("ISA_LOCAL_HEALTH_CHECK_INTERVAL", "30")),
269
269
  "max_concurrent_services": int(os.getenv("ISA_MAX_CONCURRENT_SERVICES", "3")),
@@ -3,21 +3,24 @@ Logging module for ISA Model
3
3
 
4
4
  Provides comprehensive logging capabilities including:
5
5
  - Loki-based centralized application logging (via loki_logger)
6
- - InfluxDB-based inference metrics logging (via influx_logger)
7
- - Real-time monitoring and alerting
6
+ - Basic inference logging with request tracking
8
7
 
9
8
  Architecture:
10
9
  - Loki: General application logs (INFO, WARNING, ERROR, DEBUG)
11
- - InfluxDB: Inference metrics (tokens, costs, performance data)
10
+ - Basic logging: Simple request tracking and basic metrics
12
11
  """
13
12
 
14
- # InfluxDB inference metrics logging
15
- from .influx_logger import (
16
- InfluxInferenceLogger,
17
- InferenceLogEntry,
18
- get_inference_logger,
19
- generate_request_id
20
- )
13
+ # Basic inference logging (no external dependencies)
14
+ import uuid
15
+ import logging
16
+
17
+ def generate_request_id():
18
+ """Generate unique request ID for tracking"""
19
+ return str(uuid.uuid4())
20
+
21
+ def get_inference_logger():
22
+ """Get basic inference logger"""
23
+ return logging.getLogger("isa_model.inference")
21
24
 
22
25
  # Loki centralized application logging
23
26
  from .loki_logger import (
@@ -34,9 +37,7 @@ from .loki_logger import (
34
37
  )
35
38
 
36
39
  __all__ = [
37
- # InfluxDB inference logging
38
- 'InfluxInferenceLogger',
39
- 'InferenceLogEntry',
40
+ # Basic inference logging
40
41
  'get_inference_logger',
41
42
  'generate_request_id',
42
43
 
@@ -2,8 +2,6 @@ from typing import Dict, Optional, List, Any
2
2
  import logging
3
3
  from pathlib import Path
4
4
  from datetime import datetime
5
- from huggingface_hub import hf_hub_download, snapshot_download
6
- from huggingface_hub.errors import HfHubHTTPError
7
5
  from .model_storage import ModelStorage, LocalModelStorage
8
6
  from .model_repo import ModelRegistry, ModelType, ModelCapability
9
7
  from .model_billing_tracker import ModelBillingTracker, ModelOperationType
@@ -102,73 +100,7 @@ class ModelManager:
102
100
  logger.warning(f"Failed to find cheapest model for {provider}: {e}")
103
101
  return None
104
102
 
105
- async def get_model(self,
106
- model_id: str,
107
- repo_id: str,
108
- model_type: ModelType,
109
- capabilities: List[ModelCapability],
110
- revision: Optional[str] = None,
111
- force_download: bool = False) -> Optional[Path]:
112
- """
113
- Get model files, downloading if necessary
114
-
115
- Args:
116
- model_id: Unique identifier for the model
117
- repo_id: Hugging Face repository ID
118
- model_type: Type of model (LLM, embedding, etc.)
119
- capabilities: List of model capabilities
120
- revision: Specific model version/tag
121
- force_download: Force re-download even if cached
122
-
123
- Returns:
124
- Path to the model files or None if failed
125
- """
126
- # Check if model is already downloaded
127
- if not force_download:
128
- model_path = await self.storage.load_model(model_id)
129
- if model_path:
130
- logger.info(f"Using cached model {model_id}")
131
- return model_path
132
-
133
- try:
134
- # Download model files
135
- logger.info(f"Downloading model {model_id} from {repo_id}")
136
- model_dir = Path(f"./models/temp/{model_id}")
137
- model_dir.mkdir(parents=True, exist_ok=True)
138
-
139
- snapshot_download(
140
- repo_id=repo_id,
141
- revision=revision,
142
- local_dir=model_dir,
143
- local_dir_use_symlinks=False
144
- )
145
-
146
- # Save model and metadata
147
- metadata = {
148
- "repo_id": repo_id,
149
- "revision": revision,
150
- "downloaded_at": str(Path(model_dir).stat().st_mtime)
151
- }
152
-
153
- # Register model
154
- self.registry.register_model(
155
- model_id=model_id,
156
- model_type=model_type,
157
- capabilities=capabilities,
158
- metadata=metadata
159
- )
160
-
161
- # Save model files
162
- await self.storage.save_model(model_id, str(model_dir), metadata)
163
-
164
- return await self.storage.load_model(model_id)
165
-
166
- except HfHubHTTPError as e:
167
- logger.error(f"Failed to download model {model_id}: {e}")
168
- return None
169
- except Exception as e:
170
- logger.error(f"Unexpected error downloading model {model_id}: {e}")
171
- return None
103
+ # Local model download functionality removed - use cloud API services only
172
104
 
173
105
  async def list_models(self) -> List[Dict[str, Any]]:
174
106
  """List all downloaded models with their metadata"""
@@ -39,11 +39,13 @@ class ModelStorage(ABC):
39
39
  class LocalModelStorage(ModelStorage):
40
40
  """Local file system based model storage"""
41
41
 
42
- def __init__(self, base_dir: str = "./models"):
42
+ def __init__(self, base_dir: str = "./models", auto_create: bool = False):
43
43
  self.base_dir = Path(base_dir)
44
44
  self.models_dir = self.base_dir / "models"
45
45
  self.metadata_file = self.base_dir / "model_metadata.json"
46
- self._ensure_directories()
46
+ self.auto_create = auto_create
47
+ if auto_create:
48
+ self._ensure_directories()
47
49
  self._load_metadata()
48
50
 
49
51
  def _ensure_directories(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: isa_model
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Unified AI model serving framework
5
5
  Author: isA_Model Contributors
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -89,6 +89,11 @@ Requires-Dist: isa-model[cloud,k8s,monitoring,storage]; extra == "production"
89
89
  Provides-Extra: staging
90
90
  Requires-Dist: isa-model[cloud,langchain,monitoring,storage]; extra == "staging"
91
91
  Requires-Dist: python-consul>=1.1.0; extra == "staging"
92
+ Provides-Extra: staging-minimal
93
+ Requires-Dist: isa-model[cloud,langchain,storage]; extra == "staging-minimal"
94
+ Requires-Dist: influxdb-client>=1.36.0; extra == "staging-minimal"
95
+ Requires-Dist: python-logging-loki>=0.3.1; extra == "staging-minimal"
96
+ Requires-Dist: python-consul>=1.1.0; extra == "staging-minimal"
92
97
  Provides-Extra: all
93
98
  Requires-Dist: isa-model[audio,cloud,gpu-cloud,k8s,langchain,local,monitoring,storage,training,vision]; extra == "all"
94
99
 
@@ -1,6 +1,6 @@
1
1
  isa_model/__init__.py,sha256=lYYKstKw33oavW6xS0-9cpsdYq-h0cfV_ZlGAwICRaU,868
2
2
  isa_model/client.py,sha256=7OUA6yi0G94I8U4GOFcoXvCjWxk2ds1-3CDCivJXA6M,67628
3
- isa_model/core/config.py,sha256=9OL8_EkBcnAH-RgyWUi3jblKo42m7K1JDeHa9C5CPL4,19519
3
+ isa_model/core/config.py,sha256=EWadZRo3LY2gZzL81MnqK-39lUDhaFtLiVE4aoEdXZI,19456
4
4
  isa_model/core/dependencies.py,sha256=2ZgGDjtYitBEVy8H3UppQSb_BId3--f2kQw-Lm4Umh8,10050
5
5
  isa_model/core/pricing_manager.py,sha256=NWQLhNIzUDqS5_jBfVcJGrdOdRasFyifSNCliaIDvqU,17122
6
6
  isa_model/core/types.py,sha256=jdO_q0FDuzvWURXZtxMV1Zj1XgARX9kopTviWFuq_FU,8713
@@ -14,39 +14,28 @@ isa_model/core/database/migrations.py,sha256=RpM1eqt7Chu736K0ij_42gKMYHg2HPR_qSt
14
14
  isa_model/core/database/supabase_client.py,sha256=waY0VQLy9VM6FMIoViDe5yAgNW78qJaI3Jb2ohTNj98,11124
15
15
  isa_model/core/discovery/__init__.py,sha256=U7YzSNqsyPYmT_TdMlLy9QMAotdfaFlDE-c9XgKk8-4,380
16
16
  isa_model/core/discovery/consul_discovery.py,sha256=UziTVGVbejh0zUvayhISkiRJ5KeFcxUkw8t4gTK0UVw,6631
17
- isa_model/core/logging/__init__.py,sha256=9PA5MJvn7y73aCUUqCgv5r2it2nNb38YXSG31oxNIDA,1213
18
- isa_model/core/logging/influx_logger.py,sha256=TsPnWeKgV6pl2cz9NoqM0OV9z9jI1_uVbn6nTblfM94,19483
17
+ isa_model/core/logging/__init__.py,sha256=pYQtm4GhZTEODS3tWA8EGXYhJpqK-JoZyqSPIdAANoY,1237
19
18
  isa_model/core/logging/loki_logger.py,sha256=pFkKFK5ouKNa9dPehC_kV6af0urnAvzfvbYE5IFiwD0,4706
20
19
  isa_model/core/models/__init__.py,sha256=bDzyE0KHIJxxoN3q08pvW_hHBeHux2aMdeKY4GlDzmU,1286
21
20
  isa_model/core/models/config_models.py,sha256=Gy0oNndDsKVQ92Bz6aZp1JMqr4Z0jdoEJCCscIrpogI,22955
22
21
  isa_model/core/models/deployment_billing_tracker.py,sha256=hW2e3vUkASvCycYhBdrZcsEtBjYo3TLTVpfwfVkaXnQ,16406
23
22
  isa_model/core/models/model_billing_tracker.py,sha256=er35dsoKAGt8bjkQwO9f3MQ6U_NI6OIuhIn4PEOPEWU,17302
24
- isa_model/core/models/model_manager.py,sha256=vjFYWxmhRGUDlrHkwySjN5d0hfCx-VqBKiMhgTXjs8Y,17093
23
+ isa_model/core/models/model_manager.py,sha256=N_Y3kRRfV_8MPIkfNz1aKcSW_j6tDvTJ2rXRPDrd31U,14611
25
24
  isa_model/core/models/model_metadata.py,sha256=C6ubW12qmXAuqKmE_2BaO4HMB7WJqBkYDVXYCINsc-4,25148
26
25
  isa_model/core/models/model_repo.py,sha256=1018Qi8fMfgXtU8DKfWvf-0hBE16Q7wJIzmEZa7x6bw,19868
27
26
  isa_model/core/models/model_statistics_tracker.py,sha256=4KoKawwtEDAx8FV9ysmZS4nvRqZAgRSSIa-32f_Jhwk,10561
28
- isa_model/core/models/model_storage.py,sha256=gpW7R_wDQh0WUo4CYkrQen9GMKn8Z8ys5iGQenaMmCM,4473
27
+ isa_model/core/models/model_storage.py,sha256=nfzesUgImbdHqTL82fTxsAeFCIGMtG1y-WIVXIQznMY,4567
29
28
  isa_model/core/models/model_version_manager.py,sha256=20BwNbCg1NlcmHmCxK_zMvpPmVFHg0B6ZCFnPLY6Yj8,37563
30
29
  isa_model/core/models/system_models.py,sha256=I52nTi0UVft8tkJdb2LZrJ_Qxax-JE00_YKqnSa-P4E,32525
31
30
  isa_model/core/repositories/__init__.py,sha256=RRERY7mWZxhSAZa4m6493l6sFl3CPlyL2bW6qJMEzD8,172
32
31
  isa_model/core/repositories/config_repository.py,sha256=QlL22r_bGEV6mHfmztEIY5Zw3wIFoiR5IQJyIj36wXU,37428
33
32
  isa_model/core/resilience/circuit_breaker.py,sha256=Ccoh3O31xVFJO2A0flnc9SI-sRqQ3sGKbwv3WbgJxBc,12435
34
- isa_model/core/security/secrets.py,sha256=kzRjpSiGwY9z47NUlurK29uY_uMsA5lqk8_6Ywu8Zvw,13319
35
33
  isa_model/core/services/__init__.py,sha256=TEE58Vk8JKIaQx8ELeAaWo-WPz0hjck9x-ZK7pbfiIE,422
36
34
  isa_model/core/services/intelligent_model_selector.py,sha256=PPUWiMcV8DkCPMHhnIlsBgksUY8hKB4SjlFDW1zhLYY,29205
37
- isa_model/core/storage/hf_storage.py,sha256=k271Rg5G7qUJAJ6VXQBTUHGU6y2NYBNWKVeBJm02DRo,14736
38
35
  isa_model/core/storage/local_storage.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
36
  isa_model/deployment/__init__.py,sha256=Y3IUEOriJYVZ-3ZEamMs4n6_X0OwtD2eguwBas5zgtg,345
40
37
  isa_model/deployment/core/__init__.py,sha256=TRJ4tNjNFub_ObhZy61iZZpqC0CYsnv1HV1Qp_XWhVI,119
41
38
  isa_model/deployment/core/deployment_manager.py,sha256=In2e5EuXwVJfg6ENjigOrgQyy19DCWX5uuwSa--Czzc,58337
42
- isa_model/deployment/local/__init__.py,sha256=Ld1QbaDHIHnbW2IkSXVTZeDcxnmUXBa074uOSLRu5t0,904
43
- isa_model/deployment/local/config.py,sha256=Kft5EORBcsO2HVizD0ct6VFIIs9sVBN-CjRnOrcm00g,9246
44
- isa_model/deployment/local/gpu_gateway.py,sha256=be6d9eSWRufXvJH9GyklBWlXhOukITY1lnXTM6RPcQs,21954
45
- isa_model/deployment/local/health_checker.py,sha256=_u2vwiwEGCbFA6laUu1JX6GfE6prrOSHiy6PclimGys,16392
46
- isa_model/deployment/local/provider.py,sha256=6E1WfTUvI32aeEQs13TIyuy9xQmZqJeaJULfE2KLe4E,22763
47
- isa_model/deployment/local/tensorrt_service.py,sha256=f05BkJMw2NhiMp18xW1RwRED4bIjZ0gmUS5OgEAGnk0,23026
48
- isa_model/deployment/local/transformers_service.py,sha256=pdC3KppUzSVrWd-CKA8fXPC1uzy45S8FTtQj9odAWpM,23937
49
- isa_model/deployment/local/vllm_service.py,sha256=zVuBopgzG6ulSvHnRE8h_dLQQpNqTDwHbXo88IKXrwk,18849
50
39
  isa_model/deployment/modal/__init__.py,sha256=ZBcToGNtL6ztWY5pvqM1YMiL_F-S1xx9b-uZd8cuajc,380
51
40
  isa_model/deployment/modal/config.py,sha256=8XhBMIbx6oDTf-P9ipQ58xmBYDbNZekZ4gixorBDIpw,4267
52
41
  isa_model/deployment/modal/deployer.py,sha256=YNCtbO8FTVstz8OG6Kh8p3AM05dtbg5i73-JsuNy4KM,31961
@@ -98,7 +87,6 @@ isa_model/inference/repositories/__init__.py,sha256=SYTQX1E5L6zTuo_p_KnDjYefoCKw
98
87
  isa_model/inference/repositories/inference_repository.py,sha256=QnfSzkcLQ5CPcABTmSYBRAv_5SVk0ayjVW6B1Q0SKaQ,31718
99
88
  isa_model/inference/services/__init__.py,sha256=yfLz0YGl8ixk6LfTRL6cRTvZMb9F_Pv1QRgGyNc9xYM,386
100
89
  isa_model/inference/services/base_service.py,sha256=NJIvq7YpGw55ah-axDR2hcu40B2gm6L_WYXyfX0rSaE,5816
101
- isa_model/inference/services/custom_model_manager.py,sha256=HUHSDOWArJYMfdvaI-gfCJkVRVFdftScOw7BgS-h3zo,10829
102
90
  isa_model/inference/services/audio/__init__.py,sha256=Hgtk3j5H4U3YxNlfG8UaU2eUNOWgrpSA8LN_tKEFWMk,616
103
91
  isa_model/inference/services/audio/base_realtime_service.py,sha256=hSP89_hnzLBnmBvFOQlU_tW8UT2QKWKVR9Z7fwsVPa8,8125
104
92
  isa_model/inference/services/audio/base_stt_service.py,sha256=qahYTLpf8gruvhEtS5bWDXPiYbgxXF3nYnqTq3Ckc0E,13361
@@ -128,7 +116,6 @@ isa_model/inference/services/llm/__init__.py,sha256=aiNdB692nopCy8QaopVDB0e-J7mg
128
116
  isa_model/inference/services/llm/base_llm_service.py,sha256=CUw24rMytVXAUcberTzogKRLwYZiYifyg-kcNfHiHkg,36402
129
117
  isa_model/inference/services/llm/cerebras_llm_service.py,sha256=8BU9I7HHO481nn7ddsiP4nl2ItYTCQJzJyaIArKA0ZA,25126
130
118
  isa_model/inference/services/llm/huggingface_llm_service.py,sha256=mWnOGh3OsRyaL002Ax71Mb7oXp254VDDdP0QiQ-p9Yk,22733
131
- isa_model/inference/services/llm/local_llm_service.py,sha256=_ILRD-oKcolf972aXe3zPS_tBu8SD-xH_Iw29alpkHM,27606
132
119
  isa_model/inference/services/llm/ollama_llm_service.py,sha256=78VNSspzlQrXDqAxUR52jLGIKnBw4e_4LT2unAFMiTk,17967
133
120
  isa_model/inference/services/llm/openai_llm_service.py,sha256=BpYugS2Vsrc-SS69cnW2VqFv4JXMbgglXvvbNgUZNZY,43874
134
121
  isa_model/inference/services/llm/yyds_llm_service.py,sha256=ZHl2ukcDVkwYahF4OV5etTvJKa9Ni6O1TkJp75pQWaA,12495
@@ -139,7 +126,6 @@ isa_model/inference/services/ml/base_ml_service.py,sha256=mLBA6ENowa3KVzNqHyhWxf
139
126
  isa_model/inference/services/ml/sklearn_ml_service.py,sha256=Lf9JrwvI25lca7JBbjB_e66eAUtXFbwxZ3Hs13dVGkA,5512
140
127
  isa_model/inference/services/vision/__init__.py,sha256=1GO2NoC7p8IJ92mI6fGcPaN4MeFzLhdNdNlAnFYpzpE,1839
141
128
  isa_model/inference/services/vision/base_vision_service.py,sha256=mjrfcUT01HBi0k1qeIL3CkpkvQIuL_jar-N03W8sMV8,10531
142
- isa_model/inference/services/vision/blip_vision_service.py,sha256=tmGCznQ9qBsidLV_mnKEtvpSUPvBUbwJdwviKYXrrkA,12020
143
129
  isa_model/inference/services/vision/isa_vision_service.py,sha256=OPuIZmG_lYOgajGfrQj4uLzVk5Y4H0PkeSNViIiL1O0,22960
144
130
  isa_model/inference/services/vision/openai_vision_service.py,sha256=LeD910WWyJd6QiJncSM3x_Whj-a32Vr1_2FG4gfjtc4,10179
145
131
  isa_model/inference/services/vision/replicate_vision_service.py,sha256=smRkSCTwk5mvyKVnvyplqPNuVYjRZngVBWxTCbFmrxA,20679
@@ -187,7 +173,7 @@ isa_model/serving/api/schemas/__init__.py,sha256=Tu_hzxoKW1ZHpww3-5ER4A2hNuDByZ0
187
173
  isa_model/serving/api/schemas/common.py,sha256=HVaAS7wlvqrwC1gMZ2Cvo0vzHB053x2uOTAwUoY2vsE,696
188
174
  isa_model/serving/api/schemas/ui_analysis.py,sha256=IpOcIvmUeXN1UtZsbGozMfV1vvz7AVF2PVXjjxYl_0k,4089
189
175
  isa_model/utils/gpu_utils.py,sha256=HbMvJzSsOCcjOJluUrszAJ58dC8LPnyA_nQn9s_1I6c,11730
190
- isa_model-0.4.3.dist-info/METADATA,sha256=2xHn4pAvo10QKBDQK34v0-acBWGBUZRR6ZUZa-xq7BU,15090
191
- isa_model-0.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
192
- isa_model-0.4.3.dist-info/top_level.txt,sha256=eHSy_Xb3kNkh2kK11mi1mZh0Wz91AQ5b8k2KFYO-rE8,10
193
- isa_model-0.4.3.dist-info/RECORD,,
176
+ isa_model-0.4.5.dist-info/METADATA,sha256=wepLxrhF_7CMPHcQRRXTvSkm8tkIv5fn997d5zl-c-8,15401
177
+ isa_model-0.4.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
178
+ isa_model-0.4.5.dist-info/top_level.txt,sha256=eHSy_Xb3kNkh2kK11mi1mZh0Wz91AQ5b8k2KFYO-rE8,10
179
+ isa_model-0.4.5.dist-info/RECORD,,