Skip to content

[serve] Local testing mode doesn't support user_config #52051

@zcin

Description

@zcin

Running the following:

from typing import Any

from ray import serve


@serve.deployment(user_config={"name": "Ophir"})
class MostBasicIngress:
    def __init__(self) -> None:
        self.user_config = {"name": "Corey"}

    async def reconfigure(self, user_config: dict[str, Any]) -> None:
        print("Reconfiguring...")
        self.user_config = user_config

    async def __call__(self) -> str:
        name = self.user_config["name"]
        return f"Hello {name}!"


app = MostBasicIngress.bind()
handle = serve.run(app, _local_testing_mode=True)
print(handle.remote().result())

Prints:

INFO 2025-04-06 12:26:39,058 serve 91665 -- Initializing local replica class for Deployment(name='MostBasicIngress', app='default').
Hello Corey!

Metadata

Metadata

Assignees

Labels

P2Important issue, but not time-criticalcommunity-backlogserveRay Serve Related Issue

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions