mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
feat: support workers in run config (#3992)
# What does this PR do? ## Test Plan Set workers: 4 in run.yaml. Start server and observe logs multiple times.
This commit is contained in:
parent
6f90a7af4b
commit
0e384a55a1
2 changed files with 6 additions and 1 deletions
|
|
@ -127,7 +127,7 @@ class StackRun(Subcommand):
|
||||||
config = StackRunConfig(**cast_image_name_to_string(replace_env_vars(config_contents)))
|
config = StackRunConfig(**cast_image_name_to_string(replace_env_vars(config_contents)))
|
||||||
|
|
||||||
port = args.port or config.server.port
|
port = args.port or config.server.port
|
||||||
host = config.server.host or ["::", "0.0.0.0"]
|
host = config.server.host or "0.0.0.0"
|
||||||
|
|
||||||
# Set the config file in environment so create_app can find it
|
# Set the config file in environment so create_app can find it
|
||||||
os.environ["LLAMA_STACK_CONFIG"] = str(config_file)
|
os.environ["LLAMA_STACK_CONFIG"] = str(config_file)
|
||||||
|
|
@ -139,6 +139,7 @@ class StackRun(Subcommand):
|
||||||
"lifespan": "on",
|
"lifespan": "on",
|
||||||
"log_level": logger.getEffectiveLevel(),
|
"log_level": logger.getEffectiveLevel(),
|
||||||
"log_config": logger_config,
|
"log_config": logger_config,
|
||||||
|
"workers": config.server.workers,
|
||||||
}
|
}
|
||||||
|
|
||||||
keyfile = config.server.tls_keyfile
|
keyfile = config.server.tls_keyfile
|
||||||
|
|
|
||||||
|
|
@ -473,6 +473,10 @@ class ServerConfig(BaseModel):
|
||||||
"- true: Enable localhost CORS for development\n"
|
"- true: Enable localhost CORS for development\n"
|
||||||
"- {allow_origins: [...], allow_methods: [...], ...}: Full configuration",
|
"- {allow_origins: [...], allow_methods: [...], ...}: Full configuration",
|
||||||
)
|
)
|
||||||
|
workers: int = Field(
|
||||||
|
default=1,
|
||||||
|
description="Number of workers to use for the server",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class StackRunConfig(BaseModel):
|
class StackRunConfig(BaseModel):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue