llama-stack 0.4.2__py3-none-any.whl → 0.4.4__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.
Files changed (182) hide show
  1. llama_stack/core/library_client.py +80 -3
  2. llama_stack/core/routing_tables/common.py +11 -0
  3. llama_stack/core/routing_tables/vector_stores.py +4 -0
  4. llama_stack/core/stack.py +16 -1
  5. llama_stack/core/storage/kvstore/kvstore.py +11 -0
  6. llama_stack/core/storage/kvstore/mongodb/mongodb.py +5 -0
  7. llama_stack/core/storage/kvstore/postgres/postgres.py +8 -0
  8. llama_stack/core/storage/kvstore/redis/redis.py +5 -0
  9. llama_stack/core/storage/sqlstore/sqlalchemy_sqlstore.py +8 -0
  10. llama_stack/core/storage/sqlstore/sqlstore.py +8 -0
  11. llama_stack/distributions/dell/doc_template.md +209 -0
  12. llama_stack/distributions/meta-reference-gpu/doc_template.md +119 -0
  13. llama_stack/distributions/nvidia/doc_template.md +170 -0
  14. llama_stack/distributions/oci/doc_template.md +140 -0
  15. llama_stack/models/llama/llama3/dog.jpg +0 -0
  16. llama_stack/models/llama/llama3/pasta.jpeg +0 -0
  17. llama_stack/models/llama/resources/dog.jpg +0 -0
  18. llama_stack/models/llama/resources/pasta.jpeg +0 -0
  19. llama_stack/models/llama/resources/small_dog.jpg +0 -0
  20. llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py +184 -33
  21. llama_stack/providers/inline/agents/meta_reference/responses/streaming.py +4 -0
  22. llama_stack/providers/inline/agents/meta_reference/responses/tool_executor.py +9 -1
  23. llama_stack/providers/inline/ios/inference/LocalInferenceImpl/LocalInference.h +9 -0
  24. llama_stack/providers/inline/ios/inference/LocalInferenceImpl/LocalInference.swift +189 -0
  25. llama_stack/providers/inline/ios/inference/LocalInferenceImpl/Parsing.swift +238 -0
  26. llama_stack/providers/inline/ios/inference/LocalInferenceImpl/PromptTemplate.swift +12 -0
  27. llama_stack/providers/inline/ios/inference/LocalInferenceImpl/SystemPrompts.swift +89 -0
  28. llama_stack/providers/inline/ios/inference/LocalInferenceImpl.xcodeproj/project.pbxproj +550 -0
  29. llama_stack/providers/inline/ios/inference/LocalInferenceImpl.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  30. llama_stack/providers/inline/ios/inference/LocalInferenceImpl.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  31. llama_stack/providers/remote/datasetio/nvidia/README.md +74 -0
  32. llama_stack/providers/remote/eval/nvidia/README.md +134 -0
  33. llama_stack/providers/remote/files/s3/README.md +266 -0
  34. llama_stack/providers/remote/inference/nvidia/NVIDIA.md +203 -0
  35. llama_stack/providers/remote/post_training/nvidia/README.md +151 -0
  36. llama_stack/providers/remote/safety/nvidia/README.md +78 -0
  37. llama_stack/providers/remote/vector_io/pgvector/pgvector.py +13 -1
  38. llama_stack/providers/utils/inference/embedding_mixin.py +20 -16
  39. llama_stack/providers/utils/memory/openai_vector_store_mixin.py +33 -0
  40. llama_stack/providers/utils/responses/responses_store.py +34 -0
  41. llama_stack/providers/utils/tools/mcp.py +258 -16
  42. {llama_stack-0.4.2.dist-info → llama_stack-0.4.4.dist-info}/METADATA +2 -2
  43. {llama_stack-0.4.2.dist-info → llama_stack-0.4.4.dist-info}/RECORD +47 -158
  44. {llama_stack-0.4.2.dist-info → llama_stack-0.4.4.dist-info}/WHEEL +1 -1
  45. llama_stack-0.4.4.dist-info/top_level.txt +1 -0
  46. llama_stack-0.4.2.dist-info/top_level.txt +0 -2
  47. llama_stack_api/__init__.py +0 -945
  48. llama_stack_api/admin/__init__.py +0 -45
  49. llama_stack_api/admin/api.py +0 -72
  50. llama_stack_api/admin/fastapi_routes.py +0 -117
  51. llama_stack_api/admin/models.py +0 -113
  52. llama_stack_api/agents.py +0 -173
  53. llama_stack_api/batches/__init__.py +0 -40
  54. llama_stack_api/batches/api.py +0 -53
  55. llama_stack_api/batches/fastapi_routes.py +0 -113
  56. llama_stack_api/batches/models.py +0 -78
  57. llama_stack_api/benchmarks/__init__.py +0 -43
  58. llama_stack_api/benchmarks/api.py +0 -39
  59. llama_stack_api/benchmarks/fastapi_routes.py +0 -109
  60. llama_stack_api/benchmarks/models.py +0 -109
  61. llama_stack_api/common/__init__.py +0 -5
  62. llama_stack_api/common/content_types.py +0 -101
  63. llama_stack_api/common/errors.py +0 -95
  64. llama_stack_api/common/job_types.py +0 -38
  65. llama_stack_api/common/responses.py +0 -77
  66. llama_stack_api/common/training_types.py +0 -47
  67. llama_stack_api/common/type_system.py +0 -146
  68. llama_stack_api/connectors.py +0 -146
  69. llama_stack_api/conversations.py +0 -270
  70. llama_stack_api/datasetio.py +0 -55
  71. llama_stack_api/datasets/__init__.py +0 -61
  72. llama_stack_api/datasets/api.py +0 -35
  73. llama_stack_api/datasets/fastapi_routes.py +0 -104
  74. llama_stack_api/datasets/models.py +0 -152
  75. llama_stack_api/datatypes.py +0 -373
  76. llama_stack_api/eval.py +0 -137
  77. llama_stack_api/file_processors/__init__.py +0 -27
  78. llama_stack_api/file_processors/api.py +0 -64
  79. llama_stack_api/file_processors/fastapi_routes.py +0 -78
  80. llama_stack_api/file_processors/models.py +0 -42
  81. llama_stack_api/files/__init__.py +0 -35
  82. llama_stack_api/files/api.py +0 -51
  83. llama_stack_api/files/fastapi_routes.py +0 -124
  84. llama_stack_api/files/models.py +0 -107
  85. llama_stack_api/inference.py +0 -1169
  86. llama_stack_api/inspect_api/__init__.py +0 -37
  87. llama_stack_api/inspect_api/api.py +0 -25
  88. llama_stack_api/inspect_api/fastapi_routes.py +0 -76
  89. llama_stack_api/inspect_api/models.py +0 -28
  90. llama_stack_api/internal/__init__.py +0 -9
  91. llama_stack_api/internal/kvstore.py +0 -26
  92. llama_stack_api/internal/sqlstore.py +0 -79
  93. llama_stack_api/llama_stack_api/__init__.py +0 -945
  94. llama_stack_api/llama_stack_api/admin/__init__.py +0 -45
  95. llama_stack_api/llama_stack_api/admin/api.py +0 -72
  96. llama_stack_api/llama_stack_api/admin/fastapi_routes.py +0 -117
  97. llama_stack_api/llama_stack_api/admin/models.py +0 -113
  98. llama_stack_api/llama_stack_api/agents.py +0 -173
  99. llama_stack_api/llama_stack_api/batches/__init__.py +0 -40
  100. llama_stack_api/llama_stack_api/batches/api.py +0 -53
  101. llama_stack_api/llama_stack_api/batches/fastapi_routes.py +0 -113
  102. llama_stack_api/llama_stack_api/batches/models.py +0 -78
  103. llama_stack_api/llama_stack_api/benchmarks/__init__.py +0 -43
  104. llama_stack_api/llama_stack_api/benchmarks/api.py +0 -39
  105. llama_stack_api/llama_stack_api/benchmarks/fastapi_routes.py +0 -109
  106. llama_stack_api/llama_stack_api/benchmarks/models.py +0 -109
  107. llama_stack_api/llama_stack_api/common/__init__.py +0 -5
  108. llama_stack_api/llama_stack_api/common/content_types.py +0 -101
  109. llama_stack_api/llama_stack_api/common/errors.py +0 -95
  110. llama_stack_api/llama_stack_api/common/job_types.py +0 -38
  111. llama_stack_api/llama_stack_api/common/responses.py +0 -77
  112. llama_stack_api/llama_stack_api/common/training_types.py +0 -47
  113. llama_stack_api/llama_stack_api/common/type_system.py +0 -146
  114. llama_stack_api/llama_stack_api/connectors.py +0 -146
  115. llama_stack_api/llama_stack_api/conversations.py +0 -270
  116. llama_stack_api/llama_stack_api/datasetio.py +0 -55
  117. llama_stack_api/llama_stack_api/datasets/__init__.py +0 -61
  118. llama_stack_api/llama_stack_api/datasets/api.py +0 -35
  119. llama_stack_api/llama_stack_api/datasets/fastapi_routes.py +0 -104
  120. llama_stack_api/llama_stack_api/datasets/models.py +0 -152
  121. llama_stack_api/llama_stack_api/datatypes.py +0 -373
  122. llama_stack_api/llama_stack_api/eval.py +0 -137
  123. llama_stack_api/llama_stack_api/file_processors/__init__.py +0 -27
  124. llama_stack_api/llama_stack_api/file_processors/api.py +0 -64
  125. llama_stack_api/llama_stack_api/file_processors/fastapi_routes.py +0 -78
  126. llama_stack_api/llama_stack_api/file_processors/models.py +0 -42
  127. llama_stack_api/llama_stack_api/files/__init__.py +0 -35
  128. llama_stack_api/llama_stack_api/files/api.py +0 -51
  129. llama_stack_api/llama_stack_api/files/fastapi_routes.py +0 -124
  130. llama_stack_api/llama_stack_api/files/models.py +0 -107
  131. llama_stack_api/llama_stack_api/inference.py +0 -1169
  132. llama_stack_api/llama_stack_api/inspect_api/__init__.py +0 -37
  133. llama_stack_api/llama_stack_api/inspect_api/api.py +0 -25
  134. llama_stack_api/llama_stack_api/inspect_api/fastapi_routes.py +0 -76
  135. llama_stack_api/llama_stack_api/inspect_api/models.py +0 -28
  136. llama_stack_api/llama_stack_api/internal/__init__.py +0 -9
  137. llama_stack_api/llama_stack_api/internal/kvstore.py +0 -26
  138. llama_stack_api/llama_stack_api/internal/sqlstore.py +0 -79
  139. llama_stack_api/llama_stack_api/models.py +0 -171
  140. llama_stack_api/llama_stack_api/openai_responses.py +0 -1468
  141. llama_stack_api/llama_stack_api/post_training.py +0 -370
  142. llama_stack_api/llama_stack_api/prompts.py +0 -203
  143. llama_stack_api/llama_stack_api/providers/__init__.py +0 -33
  144. llama_stack_api/llama_stack_api/providers/api.py +0 -16
  145. llama_stack_api/llama_stack_api/providers/fastapi_routes.py +0 -57
  146. llama_stack_api/llama_stack_api/providers/models.py +0 -24
  147. llama_stack_api/llama_stack_api/py.typed +0 -0
  148. llama_stack_api/llama_stack_api/rag_tool.py +0 -168
  149. llama_stack_api/llama_stack_api/resource.py +0 -37
  150. llama_stack_api/llama_stack_api/router_utils.py +0 -160
  151. llama_stack_api/llama_stack_api/safety.py +0 -132
  152. llama_stack_api/llama_stack_api/schema_utils.py +0 -208
  153. llama_stack_api/llama_stack_api/scoring.py +0 -93
  154. llama_stack_api/llama_stack_api/scoring_functions.py +0 -211
  155. llama_stack_api/llama_stack_api/shields.py +0 -93
  156. llama_stack_api/llama_stack_api/tools.py +0 -226
  157. llama_stack_api/llama_stack_api/vector_io.py +0 -941
  158. llama_stack_api/llama_stack_api/vector_stores.py +0 -51
  159. llama_stack_api/llama_stack_api/version.py +0 -9
  160. llama_stack_api/models.py +0 -171
  161. llama_stack_api/openai_responses.py +0 -1468
  162. llama_stack_api/post_training.py +0 -370
  163. llama_stack_api/prompts.py +0 -203
  164. llama_stack_api/providers/__init__.py +0 -33
  165. llama_stack_api/providers/api.py +0 -16
  166. llama_stack_api/providers/fastapi_routes.py +0 -57
  167. llama_stack_api/providers/models.py +0 -24
  168. llama_stack_api/py.typed +0 -0
  169. llama_stack_api/rag_tool.py +0 -168
  170. llama_stack_api/resource.py +0 -37
  171. llama_stack_api/router_utils.py +0 -160
  172. llama_stack_api/safety.py +0 -132
  173. llama_stack_api/schema_utils.py +0 -208
  174. llama_stack_api/scoring.py +0 -93
  175. llama_stack_api/scoring_functions.py +0 -211
  176. llama_stack_api/shields.py +0 -93
  177. llama_stack_api/tools.py +0 -226
  178. llama_stack_api/vector_io.py +0 -941
  179. llama_stack_api/vector_stores.py +0 -51
  180. llama_stack_api/version.py +0 -9
  181. {llama_stack-0.4.2.dist-info → llama_stack-0.4.4.dist-info}/entry_points.txt +0 -0
  182. {llama_stack-0.4.2.dist-info → llama_stack-0.4.4.dist-info}/licenses/LICENSE +0 -0
@@ -1,37 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the terms described in the LICENSE file in
5
- # the root directory of this source tree.
6
-
7
- """Inspect API protocol and models.
8
-
9
- This module contains the Inspect protocol definition.
10
- Pydantic models are defined in llama_stack_api.inspect.models.
11
- The FastAPI router is defined in llama_stack_api.inspect.fastapi_routes.
12
- """
13
-
14
- # Import fastapi_routes for router factory access
15
- from . import fastapi_routes
16
-
17
- # Import protocol for re-export
18
- from .api import Inspect
19
-
20
- # Import models for re-export
21
- from .models import (
22
- ApiFilter,
23
- HealthInfo,
24
- ListRoutesResponse,
25
- RouteInfo,
26
- VersionInfo,
27
- )
28
-
29
- __all__ = [
30
- "Inspect",
31
- "ApiFilter",
32
- "HealthInfo",
33
- "ListRoutesResponse",
34
- "RouteInfo",
35
- "VersionInfo",
36
- "fastapi_routes",
37
- ]
@@ -1,25 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the terms described in the LICENSE file in
5
- # the root directory of this source tree.
6
-
7
- from typing import Protocol, runtime_checkable
8
-
9
- from .models import (
10
- ApiFilter,
11
- HealthInfo,
12
- ListRoutesResponse,
13
- VersionInfo,
14
- )
15
-
16
-
17
- @runtime_checkable
18
- class Inspect(Protocol):
19
- """APIs for inspecting the Llama Stack service, including health status, available API routes with methods and implementing providers."""
20
-
21
- async def list_routes(self, api_filter: ApiFilter | None = None) -> ListRoutesResponse: ...
22
-
23
- async def health(self) -> HealthInfo: ...
24
-
25
- async def version(self) -> VersionInfo: ...
@@ -1,76 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the terms described in the LICENSE file in
5
- # the root directory of this source tree.
6
-
7
- """FastAPI router for the Inspect API.
8
-
9
- This module defines the FastAPI router for the Inspect API using standard
10
- FastAPI route decorators.
11
- """
12
-
13
- from typing import Annotated
14
-
15
- from fastapi import APIRouter, Query
16
-
17
- from llama_stack_api.router_utils import PUBLIC_ROUTE_KEY, standard_responses
18
- from llama_stack_api.version import LLAMA_STACK_API_V1
19
-
20
- from .api import Inspect
21
- from .models import (
22
- ApiFilter,
23
- HealthInfo,
24
- ListRoutesResponse,
25
- VersionInfo,
26
- )
27
-
28
-
29
- def create_router(impl: Inspect) -> APIRouter:
30
- """Create a FastAPI router for the Inspect API."""
31
- router = APIRouter(
32
- prefix=f"/{LLAMA_STACK_API_V1}",
33
- tags=["Inspect"],
34
- responses=standard_responses,
35
- )
36
-
37
- @router.get(
38
- "/inspect/routes",
39
- response_model=ListRoutesResponse,
40
- summary="List routes.",
41
- description="List all available API routes with their methods and implementing providers.",
42
- responses={200: {"description": "Response containing information about all available routes."}},
43
- )
44
- async def list_routes(
45
- api_filter: Annotated[
46
- ApiFilter | None,
47
- Query(
48
- description="Optional filter to control which routes are returned. Can be an API level ('v1', 'v1alpha', 'v1beta') to show non-deprecated routes at that level, or 'deprecated' to show deprecated routes across all levels. If not specified, returns all non-deprecated routes."
49
- ),
50
- ] = None,
51
- ) -> ListRoutesResponse:
52
- return await impl.list_routes(api_filter)
53
-
54
- @router.get(
55
- "/health",
56
- response_model=HealthInfo,
57
- summary="Get health status.",
58
- description="Get the current health status of the service.",
59
- responses={200: {"description": "Health information indicating if the service is operational."}},
60
- openapi_extra={PUBLIC_ROUTE_KEY: True},
61
- )
62
- async def health() -> HealthInfo:
63
- return await impl.health()
64
-
65
- @router.get(
66
- "/version",
67
- response_model=VersionInfo,
68
- summary="Get version.",
69
- description="Get the version of the service.",
70
- responses={200: {"description": "Version information containing the service version number."}},
71
- openapi_extra={PUBLIC_ROUTE_KEY: True},
72
- )
73
- async def version() -> VersionInfo:
74
- return await impl.version()
75
-
76
- return router
@@ -1,28 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the terms described in the LICENSE file in
5
- # the root directory of this source tree.
6
-
7
- """Pydantic models for Inspect API requests and responses.
8
-
9
- This module re-exports models from llama_stack_api.admin.models to ensure
10
- a single source of truth and avoid type conflicts.
11
- """
12
-
13
- # Import and re-export shared models from admin
14
- from llama_stack_api.admin.models import (
15
- ApiFilter,
16
- HealthInfo,
17
- ListRoutesResponse,
18
- RouteInfo,
19
- VersionInfo,
20
- )
21
-
22
- __all__ = [
23
- "ApiFilter",
24
- "RouteInfo",
25
- "HealthInfo",
26
- "VersionInfo",
27
- "ListRoutesResponse",
28
- ]
@@ -1,9 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the terms described in the LICENSE file in
5
- # the root directory of this source tree.
6
-
7
- # Internal subpackage for shared interfaces that are not part of the public API.
8
-
9
- __all__: list[str] = []
@@ -1,26 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the terms described in the LICENSE file in
5
- # the root directory of this source tree.
6
-
7
- from datetime import datetime
8
- from typing import Protocol
9
-
10
-
11
- class KVStore(Protocol):
12
- """Protocol for simple key/value storage backends."""
13
-
14
- # TODO: make the value type bytes instead of str
15
- async def set(self, key: str, value: str, expiration: datetime | None = None) -> None: ...
16
-
17
- async def get(self, key: str) -> str | None: ...
18
-
19
- async def delete(self, key: str) -> None: ...
20
-
21
- async def values_in_range(self, start_key: str, end_key: str) -> list[str]: ...
22
-
23
- async def keys_in_range(self, start_key: str, end_key: str) -> list[str]: ...
24
-
25
-
26
- __all__ = ["KVStore"]
@@ -1,79 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the terms described in the LICENSE file in
5
- # the root directory of this source tree.
6
-
7
- from collections.abc import Mapping, Sequence
8
- from enum import Enum
9
- from typing import Any, Literal, Protocol
10
-
11
- from pydantic import BaseModel
12
-
13
- from llama_stack_api import PaginatedResponse
14
-
15
-
16
- class ColumnType(Enum):
17
- INTEGER = "INTEGER"
18
- STRING = "STRING"
19
- TEXT = "TEXT"
20
- FLOAT = "FLOAT"
21
- BOOLEAN = "BOOLEAN"
22
- JSON = "JSON"
23
- DATETIME = "DATETIME"
24
-
25
-
26
- class ColumnDefinition(BaseModel):
27
- type: ColumnType
28
- primary_key: bool = False
29
- nullable: bool = True
30
- default: Any = None
31
-
32
-
33
- class SqlStore(Protocol):
34
- """Protocol for common SQL-store functionality."""
35
-
36
- async def create_table(self, table: str, schema: Mapping[str, ColumnType | ColumnDefinition]) -> None: ...
37
-
38
- async def insert(self, table: str, data: Mapping[str, Any] | Sequence[Mapping[str, Any]]) -> None: ...
39
-
40
- async def upsert(
41
- self,
42
- table: str,
43
- data: Mapping[str, Any],
44
- conflict_columns: list[str],
45
- update_columns: list[str] | None = None,
46
- ) -> None: ...
47
-
48
- async def fetch_all(
49
- self,
50
- table: str,
51
- where: Mapping[str, Any] | None = None,
52
- where_sql: str | None = None,
53
- limit: int | None = None,
54
- order_by: list[tuple[str, Literal["asc", "desc"]]] | None = None,
55
- cursor: tuple[str, str] | None = None,
56
- ) -> PaginatedResponse: ...
57
-
58
- async def fetch_one(
59
- self,
60
- table: str,
61
- where: Mapping[str, Any] | None = None,
62
- where_sql: str | None = None,
63
- order_by: list[tuple[str, Literal["asc", "desc"]]] | None = None,
64
- ) -> dict[str, Any] | None: ...
65
-
66
- async def update(self, table: str, data: Mapping[str, Any], where: Mapping[str, Any]) -> None: ...
67
-
68
- async def delete(self, table: str, where: Mapping[str, Any]) -> None: ...
69
-
70
- async def add_column_if_not_exists(
71
- self,
72
- table: str,
73
- column_name: str,
74
- column_type: ColumnType,
75
- nullable: bool = True,
76
- ) -> None: ...
77
-
78
-
79
- __all__ = ["ColumnDefinition", "ColumnType", "SqlStore"]