diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html index eb4036505..d1e6291f0 100644 --- a/docs/_static/llama-stack-spec.html +++ b/docs/_static/llama-stack-spec.html @@ -7210,6 +7210,7 @@ "preprocessor" ], "title": "ResourceType", + "const": "preprocessor", "default": "preprocessor" }, "metadata": { diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml index e3ade5821..7eac70b13 100644 --- a/docs/_static/llama-stack-spec.yaml +++ b/docs/_static/llama-stack-spec.yaml @@ -5033,6 +5033,7 @@ components: - tool_group - preprocessor title: ResourceType + const: preprocessor default: preprocessor metadata: type: object diff --git a/llama_stack/apis/preprocessing/preprocessing.py b/llama_stack/apis/preprocessing/preprocessing.py index 3385c799d..3a189573a 100644 --- a/llama_stack/apis/preprocessing/preprocessing.py +++ b/llama_stack/apis/preprocessing/preprocessing.py @@ -9,7 +9,7 @@ from typing import Any, Dict, List, Optional, Protocol, runtime_checkable from pydantic import BaseModel from llama_stack.apis.common.content_types import URL, InterleavedContent -from llama_stack.apis.preprocessing.preprocessors import Preprocessor +from llama_stack.apis.preprocessors.preprocessors import Preprocessor from llama_stack.apis.vector_io import Chunk from llama_stack.schema_utils import json_schema_type, webmethod diff --git a/llama_stack/apis/preprocessors/__init__.py b/llama_stack/apis/preprocessors/__init__.py new file mode 100644 index 000000000..0fedd853f --- /dev/null +++ b/llama_stack/apis/preprocessors/__init__.py @@ -0,0 +1,7 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from .preprocessors import * # noqa: F401 F403 diff --git a/llama_stack/apis/preprocessing/preprocessors.py b/llama_stack/apis/preprocessors/preprocessors.py similarity index 91% rename from llama_stack/apis/preprocessing/preprocessors.py rename to llama_stack/apis/preprocessors/preprocessors.py index 80cca7657..c1be3ccb7 100644 --- a/llama_stack/apis/preprocessing/preprocessors.py +++ b/llama_stack/apis/preprocessors/preprocessors.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import Any, Dict, List, Optional, Protocol, runtime_checkable +from typing import Any, Dict, List, Literal, Optional, Protocol, runtime_checkable from pydantic import BaseModel @@ -15,7 +15,7 @@ from llama_stack.schema_utils import json_schema_type, webmethod @json_schema_type class Preprocessor(Resource): - type: ResourceType = ResourceType.preprocessor + type: Literal[ResourceType.preprocessor] = ResourceType.preprocessor @property def preprocessor_id(self) -> str: diff --git a/llama_stack/distribution/datatypes.py b/llama_stack/distribution/datatypes.py index 0c48fb6b8..729dfc9bc 100644 --- a/llama_stack/distribution/datatypes.py +++ b/llama_stack/distribution/datatypes.py @@ -15,7 +15,7 @@ from llama_stack.apis.eval import Eval from llama_stack.apis.inference import Inference from llama_stack.apis.models import Model, ModelInput from llama_stack.apis.preprocessing import Preprocessing, Preprocessor -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.apis.resource import Resource from llama_stack.apis.safety import Safety from llama_stack.apis.scoring import Scoring diff --git a/llama_stack/distribution/resolver.py b/llama_stack/distribution/resolver.py index 70b8ec1f9..4b8daaab2 100644 --- a/llama_stack/distribution/resolver.py +++ b/llama_stack/distribution/resolver.py @@ -18,7 +18,7 @@ from llama_stack.apis.inspect import Inspect from llama_stack.apis.models import Models from llama_stack.apis.post_training import PostTraining from llama_stack.apis.preprocessing import Preprocessing -from llama_stack.apis.preprocessing.preprocessors import Preprocessors +from llama_stack.apis.preprocessors.preprocessors import Preprocessors from llama_stack.apis.providers import Providers as ProvidersAPI from llama_stack.apis.safety import Safety from llama_stack.apis.scoring import Scoring diff --git a/llama_stack/distribution/routers/routing_tables.py b/llama_stack/distribution/routers/routing_tables.py index 9f2669f70..ff8a80244 100644 --- a/llama_stack/distribution/routers/routing_tables.py +++ b/llama_stack/distribution/routers/routing_tables.py @@ -24,7 +24,7 @@ from llama_stack.apis.datasets import ( URIDataSource, ) from llama_stack.apis.models import ListModelsResponse, Model, Models, ModelType -from llama_stack.apis.preprocessing.preprocessors import ListPreprocessorsResponse, Preprocessor, Preprocessors +from llama_stack.apis.preprocessors.preprocessors import ListPreprocessorsResponse, Preprocessor, Preprocessors from llama_stack.apis.resource import ResourceType from llama_stack.apis.scoring_functions import ( ListScoringFunctionsResponse, diff --git a/llama_stack/distribution/stack.py b/llama_stack/distribution/stack.py index 6380090fb..88c533db5 100644 --- a/llama_stack/distribution/stack.py +++ b/llama_stack/distribution/stack.py @@ -24,7 +24,7 @@ from llama_stack.apis.inspect import Inspect from llama_stack.apis.models import Models from llama_stack.apis.post_training import PostTraining from llama_stack.apis.preprocessing import Preprocessing -from llama_stack.apis.preprocessing.preprocessors import Preprocessors +from llama_stack.apis.preprocessors.preprocessors import Preprocessors from llama_stack.apis.providers import Providers from llama_stack.apis.safety import Safety from llama_stack.apis.scoring import Scoring diff --git a/llama_stack/templates/bedrock/bedrock.py b/llama_stack/templates/bedrock/bedrock.py index 32809cb3e..2afd329cc 100644 --- a/llama_stack/templates/bedrock/bedrock.py +++ b/llama_stack/templates/bedrock/bedrock.py @@ -6,7 +6,7 @@ from pathlib import Path -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import Provider, ToolGroupInput from llama_stack.providers.inline.vector_io.faiss.config import FaissVectorIOConfig from llama_stack.providers.remote.inference.bedrock.models import MODEL_ENTRIES diff --git a/llama_stack/templates/cerebras/cerebras.py b/llama_stack/templates/cerebras/cerebras.py index e0bc0db28..ed8a127c8 100644 --- a/llama_stack/templates/cerebras/cerebras.py +++ b/llama_stack/templates/cerebras/cerebras.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ModelInput, Provider, ToolGroupInput from llama_stack.providers.inline.inference.sentence_transformers import ( SentenceTransformersInferenceConfig, diff --git a/llama_stack/templates/ci-tests/ci_tests.py b/llama_stack/templates/ci-tests/ci_tests.py index 39ec321c4..8f1ad2771 100644 --- a/llama_stack/templates/ci-tests/ci_tests.py +++ b/llama_stack/templates/ci-tests/ci_tests.py @@ -6,7 +6,7 @@ from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/dell/dell.py b/llama_stack/templates/dell/dell.py index 32ab9af15..cde0ddbbc 100644 --- a/llama_stack/templates/dell/dell.py +++ b/llama_stack/templates/dell/dell.py @@ -5,7 +5,7 @@ # the root directory of this source tree. from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/dev/dev.py b/llama_stack/templates/dev/dev.py index ef9dc5d2a..06f788391 100644 --- a/llama_stack/templates/dev/dev.py +++ b/llama_stack/templates/dev/dev.py @@ -7,7 +7,7 @@ from typing import List, Tuple from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/fireworks/fireworks.py b/llama_stack/templates/fireworks/fireworks.py index 358658cdf..2da30cb98 100644 --- a/llama_stack/templates/fireworks/fireworks.py +++ b/llama_stack/templates/fireworks/fireworks.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/groq/groq.py b/llama_stack/templates/groq/groq.py index 93b0eac52..8db15f37d 100644 --- a/llama_stack/templates/groq/groq.py +++ b/llama_stack/templates/groq/groq.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ModelInput, Provider, ToolGroupInput from llama_stack.providers.inline.inference.sentence_transformers import ( SentenceTransformersInferenceConfig, diff --git a/llama_stack/templates/hf-endpoint/hf_endpoint.py b/llama_stack/templates/hf-endpoint/hf_endpoint.py index 5f19c07c7..f59ce3b0e 100644 --- a/llama_stack/templates/hf-endpoint/hf_endpoint.py +++ b/llama_stack/templates/hf-endpoint/hf_endpoint.py @@ -5,7 +5,7 @@ # the root directory of this source tree. from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/hf-serverless/hf_serverless.py b/llama_stack/templates/hf-serverless/hf_serverless.py index b82bb4281..2f4e909e1 100644 --- a/llama_stack/templates/hf-serverless/hf_serverless.py +++ b/llama_stack/templates/hf-serverless/hf_serverless.py @@ -5,7 +5,7 @@ # the root directory of this source tree. from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/meta-reference-gpu/meta_reference.py b/llama_stack/templates/meta-reference-gpu/meta_reference.py index bc61d9632..5e6d3dac1 100644 --- a/llama_stack/templates/meta-reference-gpu/meta_reference.py +++ b/llama_stack/templates/meta-reference-gpu/meta_reference.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/meta-reference-quantized-gpu/meta_reference.py b/llama_stack/templates/meta-reference-quantized-gpu/meta_reference.py index f887be6b1..9e47a4c2d 100644 --- a/llama_stack/templates/meta-reference-quantized-gpu/meta_reference.py +++ b/llama_stack/templates/meta-reference-quantized-gpu/meta_reference.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ModelInput, Provider, ToolGroupInput from llama_stack.providers.inline.inference.meta_reference import ( MetaReferenceQuantizedInferenceConfig, diff --git a/llama_stack/templates/nvidia/nvidia.py b/llama_stack/templates/nvidia/nvidia.py index e3e8f824a..13f34373d 100644 --- a/llama_stack/templates/nvidia/nvidia.py +++ b/llama_stack/templates/nvidia/nvidia.py @@ -6,7 +6,7 @@ from pathlib import Path -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ModelInput, Provider, ShieldInput, ToolGroupInput from llama_stack.providers.remote.inference.nvidia import NVIDIAConfig from llama_stack.providers.remote.inference.nvidia.models import MODEL_ENTRIES diff --git a/llama_stack/templates/ollama/ollama.py b/llama_stack/templates/ollama/ollama.py index 1949aaff9..ce7fa38c4 100644 --- a/llama_stack/templates/ollama/ollama.py +++ b/llama_stack/templates/ollama/ollama.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/remote-vllm/vllm.py b/llama_stack/templates/remote-vllm/vllm.py index 57e46065c..0f5070ad3 100644 --- a/llama_stack/templates/remote-vllm/vllm.py +++ b/llama_stack/templates/remote-vllm/vllm.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/sambanova/sambanova.py b/llama_stack/templates/sambanova/sambanova.py index 915e0f3c7..f2456bc5b 100644 --- a/llama_stack/templates/sambanova/sambanova.py +++ b/llama_stack/templates/sambanova/sambanova.py @@ -6,7 +6,7 @@ from pathlib import Path -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import Provider, ShieldInput, ToolGroupInput from llama_stack.providers.inline.vector_io.faiss.config import FaissVectorIOConfig from llama_stack.providers.remote.inference.sambanova import SambaNovaImplConfig diff --git a/llama_stack/templates/template.py b/llama_stack/templates/template.py index c0e8e3e03..61006ea98 100644 --- a/llama_stack/templates/template.py +++ b/llama_stack/templates/template.py @@ -13,7 +13,7 @@ from pydantic import BaseModel, Field from llama_stack.apis.datasets import DatasetPurpose from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( Api, BenchmarkInput, diff --git a/llama_stack/templates/tgi/tgi.py b/llama_stack/templates/tgi/tgi.py index c5cba9e96..9f805c61e 100644 --- a/llama_stack/templates/tgi/tgi.py +++ b/llama_stack/templates/tgi/tgi.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/together/together.py b/llama_stack/templates/together/together.py index 10893afb8..2a87501e2 100644 --- a/llama_stack/templates/together/together.py +++ b/llama_stack/templates/together/together.py @@ -7,7 +7,7 @@ from pathlib import Path from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ( ModelInput, Provider, diff --git a/llama_stack/templates/vllm-gpu/vllm.py b/llama_stack/templates/vllm-gpu/vllm.py index deb413054..1c2038c04 100644 --- a/llama_stack/templates/vllm-gpu/vllm.py +++ b/llama_stack/templates/vllm-gpu/vllm.py @@ -5,7 +5,7 @@ # the root directory of this source tree. from llama_stack.apis.models.models import ModelType -from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput +from llama_stack.apis.preprocessors.preprocessors import PreprocessorInput from llama_stack.distribution.datatypes import ModelInput, Provider from llama_stack.providers.inline.inference.sentence_transformers import ( SentenceTransformersInferenceConfig,