code: def test_setting_model_id_on_handle_does_not_set_it_locally(
      serve_instance,
  ):
      """
      Verify that `.options(multiplexed_model_id="foo")` on a ServeHandle sets it in the
      downstream but does not update the model ID in the caller.
      """
  
      @serve.deployment
      class Downstream:
          def __call__(self):
              return serve.get_multiplexed_model_id()
  
      @serve.deployment
      class Upstream:
          def __init__(self, downstream: RayServeHandle):
              self._h = downstream
  
          async def __call__(self):
              model_id_before = serve.get_multiplexed_model_id()
  
              # Make a call with another model ID, verify it's set properly.
              other_model_id = await self._h.options(
                  multiplexed_model_id="bar"
              ).remote()
              assert other_model_id == "bar"
  
              # Model ID shouldn't change after the handle call.
              model_id_after = serve.get_multiplexed_model_id()
              assert model_id_before == model_id_after
  
              return model_id_before
  
      handle = serve.run(Upstream.bind(Downstream.bind()))
      assert (
          handle.options(multiplexed_model_id="foo").remote().result()
          == "foo"
      )
  
imports: import asyncio
  import os
  from typing import List
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray._private.utils import get_or_create_event_loop
  from ray.serve._private.constants import SERVE_MULTIPLEXED_MODEL_ID
  from ray.serve.context import _get_internal_replica_context
  from ray.serve.handle import RayServeHandle
  from ray.serve.multiplex import _ModelMultiplexWrapper
label_desc: Use image node_id 8 for calling a global function with example usage: test_setting_model_id_on_handle_does_not_set_it_locally(serve_instance) and returns: serve, model_id_before