orbitals 0.0.3__py3-none-any.whl → 0.1.1__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.
@@ -54,19 +54,13 @@ class ScopeGuardResponse(BaseModel):
54
54
  time_taken: float
55
55
 
56
56
 
57
- @app.post("/api/orbitals/scope-guard/validate", response_model=ScopeGuardResponse)
58
- @app.post("/api/in/scope-classifier/classify", response_model=ScopeGuardResponse)
57
+ @app.post("/orbitals/scope-guard/validate", response_model=ScopeGuardResponse)
59
58
  async def validate(
60
59
  request: Request,
61
60
  conversation: ScopeGuardInput,
62
61
  ai_service_description: Annotated[str | AIServiceDescription, Body()],
63
62
  skip_evidences: bool | None = Body(None),
64
63
  ) -> ScopeGuardResponse:
65
- if request.url.path.endswith("/api/in/scope-classifier/classify"):
66
- logging.warning(
67
- "The /api/in/scope-classifier/classify endpoint is deprecated. Please use /api/in/scope-guard/validate instead."
68
- )
69
-
70
64
  global scope_guard
71
65
 
72
66
  start_time = time.time()
@@ -85,10 +79,9 @@ async def validate(
85
79
 
86
80
 
87
81
  @app.post(
88
- "/api/orbitals/scope-guard/batch-validate",
82
+ "/orbitals/scope-guard/batch-validate",
89
83
  response_model=list[ScopeGuardResponse],
90
84
  )
91
- @app.post("/api/in/scope-classifier/batch-classify", response_model=ScopeGuardResponse)
92
85
  async def batch_validate(
93
86
  request: Request,
94
87
  conversations: list[ScopeGuardInput],
@@ -96,11 +89,6 @@ async def batch_validate(
96
89
  ai_service_descriptions: list[str] | list[AIServiceDescription] | None = None,
97
90
  skip_evidences: bool | None = Body(None),
98
91
  ) -> list[ScopeGuardResponse]:
99
- if request.url.path.endswith("/api/in/scope-classifier/batch-classify"):
100
- logging.warning(
101
- "The /api/in/scope-classifier/batch-classify endpoint is deprecated. Please use /api/in/scope-guard/batch-validate instead."
102
- )
103
-
104
92
  global scope_guard
105
93
 
106
94
  start_time = time.time()
orbitals/utils.py CHANGED
@@ -8,7 +8,7 @@ def maybe_configure_gpu_usage():
8
8
  optimal usage: search for the gpu with the most free memory, and
9
9
  set CUDA_VISIBLE_DEVICES to that GPU only.
10
10
 
11
- Uses pynvml to avoid triggering CUDA initialization from torch.
11
+ Uses nvidia-ml-py (pynvml) to avoid triggering CUDA initialization from torch.
12
12
  """
13
13
  if "CUDA_VISIBLE_DEVICES" in os.environ:
14
14
  logging.info(
@@ -17,15 +17,15 @@ def maybe_configure_gpu_usage():
17
17
  return
18
18
 
19
19
  try:
20
- import pynvml # ty: ignore[unresolved-import]
20
+ import pynvml # ty: ignore[unresolved-import] # provided by nvidia-ml-py
21
21
  except ModuleNotFoundError:
22
- logging.debug("pynvml not available, skipping GPU auto-configuration")
22
+ logging.debug("nvidia-ml-py not available, skipping GPU auto-configuration")
23
23
  return
24
24
 
25
25
  try:
26
26
  pynvml.nvmlInit()
27
27
  except pynvml.NVMLError:
28
- logging.debug("NVML initialization failed, skipping GPU auto-configuration")
28
+ logging.error("NVML initialization failed, skipping GPU auto-configuration")
29
29
  return
30
30
 
31
31
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orbitals
3
- Version: 0.0.3
3
+ Version: 0.1.1
4
4
  Summary: LLM Guardrails tailored to your Principles
5
5
  Author-email: Luigi Procopio <luigi@principled-intelligence.com>, Edoardo Barba <edoardo@principled-intelligence.com>
6
6
  License: Apache-2.0
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
13
  Classifier: Programming Language :: Python :: 3.14
14
- Requires-Python: >=3.10
14
+ Requires-Python: ==3.13
15
15
  Requires-Dist: aiohttp
16
16
  Requires-Dist: pydantic>=2.0.0
17
17
  Requires-Dist: requests
@@ -19,35 +19,38 @@ Requires-Dist: typer>=0.12.3
19
19
  Provides-Extra: all
20
20
  Requires-Dist: accelerate>=1.11.0; extra == 'all'
21
21
  Requires-Dist: fastapi[standard]>=0.119.1; extra == 'all'
22
- Requires-Dist: pynvml; extra == 'all'
22
+ Requires-Dist: nvidia-ml-py; extra == 'all'
23
23
  Requires-Dist: transformers<5.0.0,>=4.47.0; extra == 'all'
24
24
  Requires-Dist: uvicorn>=0.29.0; extra == 'all'
25
- Requires-Dist: vllm>=0.11.0; extra == 'all'
25
+ Requires-Dist: vllm<0.13.0,>=0.11.0; extra == 'all'
26
26
  Requires-Dist: xgrammar; extra == 'all'
27
27
  Provides-Extra: scope-guard-all
28
28
  Requires-Dist: accelerate>=1.11.0; extra == 'scope-guard-all'
29
29
  Requires-Dist: fastapi[standard]>=0.119.1; extra == 'scope-guard-all'
30
- Requires-Dist: pynvml; extra == 'scope-guard-all'
30
+ Requires-Dist: nvidia-ml-py; extra == 'scope-guard-all'
31
31
  Requires-Dist: transformers<5.0.0,>=4.47.0; extra == 'scope-guard-all'
32
32
  Requires-Dist: uvicorn>=0.29.0; extra == 'scope-guard-all'
33
- Requires-Dist: vllm>=0.11.0; extra == 'scope-guard-all'
33
+ Requires-Dist: vllm<0.13.0,>=0.11.0; extra == 'scope-guard-all'
34
34
  Requires-Dist: xgrammar; extra == 'scope-guard-all'
35
35
  Provides-Extra: scope-guard-hf
36
36
  Requires-Dist: accelerate>=1.11.0; extra == 'scope-guard-hf'
37
- Requires-Dist: pynvml; extra == 'scope-guard-hf'
37
+ Requires-Dist: nvidia-ml-py; extra == 'scope-guard-hf'
38
38
  Requires-Dist: transformers<5.0.0,>=4.47.0; extra == 'scope-guard-hf'
39
39
  Provides-Extra: scope-guard-serve
40
40
  Requires-Dist: fastapi[standard]>=0.119.1; extra == 'scope-guard-serve'
41
- Requires-Dist: pynvml; extra == 'scope-guard-serve'
41
+ Requires-Dist: nvidia-ml-py; extra == 'scope-guard-serve'
42
42
  Requires-Dist: transformers<5.0.0,>=4.47.0; extra == 'scope-guard-serve'
43
43
  Requires-Dist: uvicorn>=0.29.0; extra == 'scope-guard-serve'
44
- Requires-Dist: vllm>=0.11.0; extra == 'scope-guard-serve'
44
+ Requires-Dist: vllm<0.13.0,>=0.11.0; extra == 'scope-guard-serve'
45
45
  Requires-Dist: xgrammar; extra == 'scope-guard-serve'
46
46
  Provides-Extra: scope-guard-vllm
47
- Requires-Dist: pynvml; extra == 'scope-guard-vllm'
47
+ Requires-Dist: nvidia-ml-py; extra == 'scope-guard-vllm'
48
48
  Requires-Dist: transformers<5.0.0,>=4.47.0; extra == 'scope-guard-vllm'
49
- Requires-Dist: vllm>=0.11.0; extra == 'scope-guard-vllm'
49
+ Requires-Dist: vllm<0.13.0,>=0.11.0; extra == 'scope-guard-vllm'
50
50
  Requires-Dist: xgrammar; extra == 'scope-guard-vllm'
51
+ Provides-Extra: serving
52
+ Requires-Dist: fastapi[standard]>=0.119.1; extra == 'serving'
53
+ Requires-Dist: uvicorn>=0.29.0; extra == 'serving'
51
54
  Description-Content-Type: text/markdown
52
55
 
53
56
  <div align="center">
@@ -1,6 +1,6 @@
1
1
  orbitals/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
2
2
  orbitals/types.py,sha256=4oRinWPG6kbtW4lQ8bHrDmxEotncqMIwLCmQ2yGH7PI,1988
3
- orbitals/utils.py,sha256=9UFlpzTkSJeyN2n1CzUy5jIZFqnOwNYNpF4c5xIfT3E,1628
3
+ orbitals/utils.py,sha256=FoCNGgPNqD4mey7_f3Rj5XBJKsp7-krcvvr5KvmnNG4,1677
4
4
  orbitals/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  orbitals/cli/main.py,sha256=p4MEbmtJ0L8mLiyovEq7urnVc6I0mbbCNdGEtGyY60Y,197
6
6
  orbitals/scope_guard/__init__.py,sha256=0gzzSXpfRvIcCYpu3AKQSMFYDMDJaknY9pdypt7HiuI,197
@@ -16,10 +16,10 @@ orbitals/scope_guard/guards/base.py,sha256=5DQeOY7kvTgH6GSExMpy3b_KQtNWzSlrudro6
16
16
  orbitals/scope_guard/guards/hf.py,sha256=xFNl_DtRiePB3n3V2spsSwiRRYz1qZYNw-wQTyiZsCI,3967
17
17
  orbitals/scope_guard/guards/vllm.py,sha256=3LU9DKKniQd90Ibaq2Wef20fyoZXgkeQtc58XY6kX2I,8983
18
18
  orbitals/scope_guard/serving/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- orbitals/scope_guard/serving/main.py,sha256=pjUol71h7CuU_6PiB7Zjdm5eNyDVH-F8bZVNeyEL-tE,3822
19
+ orbitals/scope_guard/serving/main.py,sha256=ijOtsYOzsbXrgJrWKvNRjL5LmrxbHE74GbwgoXwulA8,3162
20
20
  orbitals/scope_guard/serving/vllm_logging_config.json,sha256=Bc08X8mQWJFAAHEE6ZFVUGnRc77pMVpPvji6BhFTtSE,651
21
- orbitals-0.0.3.dist-info/METADATA,sha256=pgtkFPmdlhU9pnorq_cfSnf0Egc36vMEbY1elxaohfU,7148
22
- orbitals-0.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
23
- orbitals-0.0.3.dist-info/entry_points.txt,sha256=fd6lukgEvK9UBwhA1JtcB9MLTqAtntA4H2cc7-nWkeU,51
24
- orbitals-0.0.3.dist-info/licenses/LICENSE,sha256=Eeclrom-K-omYcKnMvijEMV-IMiQ7X-bdgxlZcXcImI,11360
25
- orbitals-0.0.3.dist-info/RECORD,,
21
+ orbitals-0.1.1.dist-info/METADATA,sha256=ot2miZ_tcEGSlultyCrwqHh_Ev5mFGflWhp9KDxn-RI,7347
22
+ orbitals-0.1.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
23
+ orbitals-0.1.1.dist-info/entry_points.txt,sha256=fd6lukgEvK9UBwhA1JtcB9MLTqAtntA4H2cc7-nWkeU,51
24
+ orbitals-0.1.1.dist-info/licenses/LICENSE,sha256=Eeclrom-K-omYcKnMvijEMV-IMiQ7X-bdgxlZcXcImI,11360
25
+ orbitals-0.1.1.dist-info/RECORD,,