mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-07 19:12:09 +00:00
Enabled the default preprocessors in the ollama configuration.
This commit is contained in:
parent
e16bdf138f
commit
c2bd31eb5c
4 changed files with 26 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from llama_stack.apis.models.models import ModelType
|
from llama_stack.apis.models.models import ModelType
|
||||||
|
from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput
|
||||||
from llama_stack.distribution.datatypes import (
|
from llama_stack.distribution.datatypes import (
|
||||||
ModelInput,
|
ModelInput,
|
||||||
Provider,
|
Provider,
|
||||||
|
@ -80,6 +81,16 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
provider_id="code-interpreter",
|
provider_id="code-interpreter",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
default_preprocessors = [
|
||||||
|
PreprocessorInput(
|
||||||
|
preprocessor_id="builtin::basic",
|
||||||
|
provider_id="basic",
|
||||||
|
),
|
||||||
|
PreprocessorInput(
|
||||||
|
preprocessor_id="builtin::chunking",
|
||||||
|
provider_id="simple_chunking",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
return DistributionTemplate(
|
return DistributionTemplate(
|
||||||
name=name,
|
name=name,
|
||||||
|
@ -96,6 +107,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
},
|
},
|
||||||
default_models=[inference_model, embedding_model],
|
default_models=[inference_model, embedding_model],
|
||||||
default_tool_groups=default_tool_groups,
|
default_tool_groups=default_tool_groups,
|
||||||
|
default_preprocessors=default_preprocessors,
|
||||||
),
|
),
|
||||||
"run-with-safety.yaml": RunConfigSettings(
|
"run-with-safety.yaml": RunConfigSettings(
|
||||||
provider_overrides={
|
provider_overrides={
|
||||||
|
@ -130,6 +142,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
default_tool_groups=default_tool_groups,
|
default_tool_groups=default_tool_groups,
|
||||||
|
default_preprocessors=default_preprocessors,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
run_config_env_vars={
|
run_config_env_vars={
|
||||||
|
|
|
@ -127,6 +127,10 @@ tool_groups:
|
||||||
provider_id: rag-runtime
|
provider_id: rag-runtime
|
||||||
- toolgroup_id: builtin::code_interpreter
|
- toolgroup_id: builtin::code_interpreter
|
||||||
provider_id: code-interpreter
|
provider_id: code-interpreter
|
||||||
preprocessors: []
|
preprocessors:
|
||||||
|
- preprocessor_id: builtin::basic
|
||||||
|
provider_id: basic
|
||||||
|
- preprocessor_id: builtin::chunking
|
||||||
|
provider_id: simple_chunking
|
||||||
server:
|
server:
|
||||||
port: 8321
|
port: 8321
|
||||||
|
|
|
@ -116,6 +116,10 @@ tool_groups:
|
||||||
provider_id: rag-runtime
|
provider_id: rag-runtime
|
||||||
- toolgroup_id: builtin::code_interpreter
|
- toolgroup_id: builtin::code_interpreter
|
||||||
provider_id: code-interpreter
|
provider_id: code-interpreter
|
||||||
preprocessors: []
|
preprocessors:
|
||||||
|
- preprocessor_id: builtin::basic
|
||||||
|
provider_id: basic
|
||||||
|
- preprocessor_id: builtin::chunking
|
||||||
|
provider_id: simple_chunking
|
||||||
server:
|
server:
|
||||||
port: 8321
|
port: 8321
|
||||||
|
|
|
@ -12,6 +12,7 @@ import yaml
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
from llama_stack.apis.models.models import ModelType
|
from llama_stack.apis.models.models import ModelType
|
||||||
|
from llama_stack.apis.preprocessing.preprocessors import PreprocessorInput
|
||||||
from llama_stack.distribution.datatypes import (
|
from llama_stack.distribution.datatypes import (
|
||||||
Api,
|
Api,
|
||||||
BuildConfig,
|
BuildConfig,
|
||||||
|
@ -56,6 +57,7 @@ class RunConfigSettings(BaseModel):
|
||||||
default_models: Optional[List[ModelInput]] = None
|
default_models: Optional[List[ModelInput]] = None
|
||||||
default_shields: Optional[List[ShieldInput]] = None
|
default_shields: Optional[List[ShieldInput]] = None
|
||||||
default_tool_groups: Optional[List[ToolGroupInput]] = None
|
default_tool_groups: Optional[List[ToolGroupInput]] = None
|
||||||
|
default_preprocessors: Optional[List[PreprocessorInput]] = None
|
||||||
|
|
||||||
def run_config(
|
def run_config(
|
||||||
self,
|
self,
|
||||||
|
@ -113,6 +115,7 @@ class RunConfigSettings(BaseModel):
|
||||||
models=self.default_models or [],
|
models=self.default_models or [],
|
||||||
shields=self.default_shields or [],
|
shields=self.default_shields or [],
|
||||||
tool_groups=self.default_tool_groups or [],
|
tool_groups=self.default_tool_groups or [],
|
||||||
|
preprocessors=self.default_preprocessors or [],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue