Repository navigation
[serve][llm] Add Native Anthropic Messages API (/v1/messages) Support - #65486
wanadzhar913 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for the Anthropic Messages API and token counting endpoints, integrating them with the Ray Serve LLM engine and vLLM. It adds new ingress routing, Pydantic models, and helper utilities, alongside comprehensive tests. The review feedback highlights several critical robustness improvements, including handling potential null values and non-integer status codes in error translation, catching stream-time exceptions during message generation, gracefully handling empty generators or StopAsyncIteration in the ingress endpoints, and supporting string-based class names in configuration comparisons.
| def translate_error_response(response: ErrorResponse) -> JSONResponse: | ||
| anthropic_error = AnthropicErrorResponse( | ||
| error=AnthropicError( | ||
| type=response.error.type, | ||
| message=response.error.message, | ||
| ) | ||
| ) | ||
| return JSONResponse( | ||
| status_code=response.error.code, | ||
| content=anthropic_error.model_dump(exclude_none=True), | ||
| ) |
There was a problem hiding this comment.
Accessing properties on response.error without a None check violates defensive programming guidelines. Additionally, response.error.code can be a string or None in OpenAI/vLLM error responses, which will cause a runtime error in Starlette's JSONResponse since status_code must be an integer. We should safely convert the code to an integer and handle potential None values.
def translate_error_response(response: ErrorResponse) -> JSONResponse:
error_info = response.error
if error_info is None:
return JSONResponse(
status_code=500,
content={"error": {"type": "internal_error", "message": "An unknown error occurred."}},
)
try:
status_code = int(error_info.code) if error_info.code is not None else 500
except (ValueError, TypeError):
status_code = 500
anthropic_error = AnthropicErrorResponse(
error=AnthropicError(
type=error_info.type or "internal_error",
message=error_info.message or "An unknown error occurred.",
)
)
return JSONResponse(
status_code=status_code,
content=anthropic_error.model_dump(exclude_none=True),
)| if isinstance(messages_response, AsyncGenerator): | ||
| async for response in messages_response: | ||
| if not isinstance(response, str): | ||
| raise ValueError( | ||
| "Expected create_messages to return a stream of strings, " | ||
| f"got an item with type {type(response)}" | ||
| ) | ||
| yield response |
There was a problem hiding this comment.
Any exception raised during the iteration of the messages_response async generator (e.g., token generation errors, connection drops, or engine failures) will propagate uncaught because the async for loop is outside the try...except block. We should wrap the iteration in a try...except block to ensure all stream-time exceptions are properly caught and translated into error responses.
if isinstance(messages_response, AsyncGenerator):
try:
async for response in messages_response:
if not isinstance(response, str):
raise ValueError(
"Expected create_messages to return a stream of strings, "
f"got an item with type {type(response)}"
)
yield response
except Exception as e:
yield self._make_error_response(self._anthropic_serving_messages, e)| initial_response, gen = await _peek_at_generator(gen) | ||
|
|
||
| if isinstance(initial_response, ErrorResponse): | ||
| return translate_error_response(initial_response) | ||
|
|
||
| if isinstance(initial_response, str): | ||
|
|
||
| async def stream(): | ||
| yield initial_response | ||
| async for item in gen: | ||
| yield item | ||
|
|
||
| return anthropic_messages_http_response(stream()) | ||
|
|
||
| return anthropic_messages_http_response(initial_response) |
There was a problem hiding this comment.
If the generator gen is empty, initial_response will be None. Passing None to anthropic_messages_http_response will result in an invalid StreamingResponse with None content, leading to a broken or hanging connection. We should explicitly handle the None case by raising an HTTPException.
initial_response, gen = await _peek_at_generator(gen)
if initial_response is None:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail="Engine returned an empty response.",
)
if isinstance(initial_response, ErrorResponse):
return translate_error_response(initial_response)
if isinstance(initial_response, str):
async def stream():
yield initial_response
async for item in gen:
yield item
return anthropic_messages_http_response(stream())
return anthropic_messages_http_response(initial_response)| results = model_handle.count_tokens.remote(body, raw_request_info) | ||
| result = await results.__anext__() |
There was a problem hiding this comment.
await results.__anext__() can raise StopAsyncIteration if the generator is empty. This uncaught exception will bubble up and cause a 500 Internal Server Error. We should wrap it in a try...except StopAsyncIteration block to handle it gracefully.
| results = model_handle.count_tokens.remote(body, raw_request_info) | |
| result = await results.__anext__() | |
| raw_request_info = RawRequestInfo.from_starlette_request(request) | |
| results = model_handle.count_tokens.remote(body, raw_request_info) | |
| try: | |
| result = await results.__anext__() | |
| except StopAsyncIteration: | |
| raise HTTPException( | |
| status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, | |
| detail="Engine did not return any response for token counting.", | |
| ) |
| ingress_cls_config = builder_config.ingress_cls_config | ||
| if ingress_cls_config.ingress_cls == OpenAiIngress: | ||
| ingress_cls_config = IngressClsConfig( | ||
| ingress_cls=AnthropicIngress, | ||
| ingress_extra_kwargs=ingress_cls_config.ingress_extra_kwargs, | ||
| ) |
There was a problem hiding this comment.
Direct comparison ingress_cls_config.ingress_cls == OpenAiIngress will fail if ingress_cls is configured as a string (e.g., "OpenAiIngress" or "ray.serve.llm.OpenAiIngress" in a YAML configuration file). This will prevent the application from automatically switching to AnthropicIngress, leading to 404 errors on the Anthropic endpoints. We should handle both class and string comparisons.
| ingress_cls_config = builder_config.ingress_cls_config | |
| if ingress_cls_config.ingress_cls == OpenAiIngress: | |
| ingress_cls_config = IngressClsConfig( | |
| ingress_cls=AnthropicIngress, | |
| ingress_extra_kwargs=ingress_cls_config.ingress_extra_kwargs, | |
| ) | |
| ingress_cls = ingress_cls_config.ingress_cls | |
| if ingress_cls == OpenAiIngress or (isinstance(ingress_cls, str) and ingress_cls.endswith("OpenAiIngress")): | |
| ingress_cls_config = IngressClsConfig( | |
| ingress_cls=AnthropicIngress, | |
| ingress_extra_kwargs=ingress_cls_config.ingress_extra_kwargs, | |
| ) |
| ingress_cls_config = builder_config.ingress_cls_config | ||
| if ingress_cls_config.ingress_cls == OpenAiIngress: | ||
| ingress_cls_config = IngressClsConfig( | ||
| ingress_cls=AnthropicIngress, | ||
| ingress_extra_kwargs=ingress_cls_config.ingress_extra_kwargs, | ||
| ) |
There was a problem hiding this comment.
Direct comparison ingress_cls_config.ingress_cls == OpenAiIngress will fail if ingress_cls is configured as a string (e.g., "OpenAiIngress" or "ray.serve.llm.OpenAiIngress" in a YAML configuration file). This will prevent the application from automatically switching to AnthropicIngress, leading to 404 errors on the Anthropic endpoints. We should handle both class and string comparisons.
| ingress_cls_config = builder_config.ingress_cls_config | |
| if ingress_cls_config.ingress_cls == OpenAiIngress: | |
| ingress_cls_config = IngressClsConfig( | |
| ingress_cls=AnthropicIngress, | |
| ingress_extra_kwargs=ingress_cls_config.ingress_extra_kwargs, | |
| ) | |
| ingress_cls_config = builder_config.ingress_cls_config | |
| ingress_cls = ingress_cls_config.ingress_cls | |
| if ingress_cls == OpenAiIngress or (isinstance(ingress_cls, str) and ingress_cls.endswith("OpenAiIngress")): | |
| ingress_cls_config = IngressClsConfig( | |
| ingress_cls=AnthropicIngress, | |
| ingress_extra_kwargs=ingress_cls_config.ingress_extra_kwargs, | |
| ) |
eicherseiji
left a comment
There was a problem hiding this comment.
Hi @wanadzhar913, this is an exciting contribution! Please reach out on Ray Slack so we can land this
|
|
||
| if isinstance(initial_response, str): | ||
|
|
||
| async def stream(): |
There was a problem hiding this comment.
Could we stream gen directly here? _peek_at_generator() returns a replacement generator that already replays initial_response, so yielding it again duplicates the first SSE event—usually message_start—and produces an invalid event sequence for strict Anthropic clients.
There was a problem hiding this comment.
Whoops, addressed!
| DEFAULT_MAX_ONGOING_REQUESTS, | ||
| DEFAULT_MAX_TARGET_ONGOING_REQUESTS, | ||
| ) | ||
| from ray.llm._internal.serve.core.configs.anthropic_api_models import ( |
There was a problem hiding this comment.
Could we keep these vLLM-only imports off the SGLang import path, for example by loading them lazily on the Anthropic path? The supported SGLang image uninstalls vLLM, but ray.serve.llm imports the builder and then this module, so this raises before the existing OpenAI/SGLang code can load. This breaks TestSGLangProtocolDecoupling.test_modules_importable_without_vllm.
There was a problem hiding this comment.
I was wondering if we should just support SGLang off the bat in this PR (to be consistent with the vLLM path? If not, will refactor and keep vLLM-only imports off the SGLang import path.
| default_ingress_options, builder_config.ingress_deployment_config | ||
| ) | ||
|
|
||
| ingress_cls = make_fastapi_ingress( |
There was a problem hiding this comment.
Could we install Anthropic-specific validation and HTTPException handlers on this app? make_fastapi_ingress() currently uses the shared init() app, whose validation handler emits an OpenAI error envelope and whose default HTTP error response uses {"detail": ...}. As a result, malformed bodies and unknown-model errors on both Anthropic endpoints return incompatible response shapes instead of Anthropic error envelopes.
Signed-off-by: wanadzhar913 <[email protected]>
Signed-off-by: wanadzhar913 <[email protected]>
Signed-off-by: wanadzhar913 <[email protected]>
ea9fe11 to
c808b56
Compare
…tall Anthropic-specific validation and HTTPException handlers (init_anthropic_app) Signed-off-by: wanadzhar913 <[email protected]>
c808b56 to
620f340
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 620f340. Configure here.
| AnthropicCountTokensRequest, | ||
| AnthropicCountTokensResponse, | ||
| AnthropicMessagesRequest, | ||
| ) |
There was a problem hiding this comment.
Eager Anthropic import breaks SGLang
High Severity
ingress.py eagerly imports anthropic_api_models, which hard-fails without vLLM, and builder.py pulls that ingress module into the shared ray.serve.llm import path. SGLang-only installs that previously loaded OpenAI Serve LLM now fail before any Anthropic endpoint is used.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 620f340. Configure here.
|
For visibility, mirroring the discussion from Ray Slack: @wanadzhar913 would you be able to validate that mode against a real Claude Code client and report whether it is sufficient? Two considerations worth noting in advance: tool calling requires If that path works end to end, the remaining gap is test coverage and documentation rather than ingress plumbing, and we should scope this PR accordingly. |
FindingsHi @eicherseiji, yeahp you're right. It works out of the box with Some gaps I found:
Proposed ScopeThat said, as you said, happy to proceed with your proposed scope to drop the ingress plumbing, and land docs plus regression tests instead. Docs would cover:
Let me know how to proceed. Test Setup & ConfigsEnvironment
Claude Setupexport ANTHROPIC_BASE_URL=$BASE_URL
export ANTHROPIC_AUTH_TOKEN=dummy
export ANTHROPIC_MODEL=claude-sonnet-4-5-20250929
claudeRay Serve LLM commandsexport RAY_SERVE_LLM_ENABLE_DIRECT_STREAMING=1
export RAY_SERVE_ENABLE_HA_PROXY=1
ray start --head --disable-usage-stats
serve run config.yaml
|
Ray Serve LLM logs(.venv) root@bea9100ba116:/workspace# serve run config.yaml
2026-08-19 17:55:35,019 INFO scripts.py:480 -- Running config file: 'config.yaml'.
2026-08-19 17:55:35,034 INFO worker.py:1833 -- Connecting to existing Ray cluster at address: 172.24.0.2:6379...
2026-08-19 17:55:35,044 INFO worker.py:2024 -- Connected to Ray cluster.
(ServeController pid=19243) INFO 2026-08-19 17:55:38,293 controller 19243 -- HAProxy is enabled in ServeController, replacing Serve proxy with HAProxy.
(ProxyActor pid=28085) INFO 2026-08-19 17:55:42,925 proxy 172.24.0.2 -- Proxy starting on node 458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02 (HTTP port: 8500).
(ProxyActor pid=28085) INFO 2026-08-19 17:55:43,097 proxy 172.24.0.2 -- Got updated endpoints: {}.
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:43,266 proxy 172.24.0.2 -- HAProxy starting on node 458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02 (HTTP port: 8000).
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:43,307 proxy 172.24.0.2 -- Successfully generated HAProxy config file.
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:43,312 proxy 172.24.0.2 -- Using HAProxy binary: /workspace/ray/.venv/lib/python3.12/site-packages/ray_haproxy/bin/haproxy
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:43,324 proxy 172.24.0.2 -- Starting HAProxy (spawn #1, pid=28225, stdout=/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock.28089.1.stdout.log, stderr=/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock.28089.1.stderr.log); args=['/workspace/ray/.venv/lib/python3.12/site-packages/ray_haproxy/bin/haproxy', '-db', '-f', '/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/haproxy.cfg', '-dR']
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:43,425 proxy 172.24.0.2 -- Got updated backend configs: [].
(ServeController pid=19243) WARNING 2026-08-19 17:55:43,514 controller 19243 -- Proxy actor readiness check for proxy on 458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02 didn't complete in 5.0s.
(ServeController pid=19243) WARNING 2026-08-19 17:55:43,514 controller 19243 -- Proxy actor reported not ready on node 458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02
INFO 2026-08-19 17:55:43,861 serve 27898 -- Started Serve in namespace "serve".
(ServeController pid=19243) INFO 2026-08-19 17:55:43,863 controller 19243 -- Deploying new app 'anthropic-direct'.
(ServeController pid=19243) INFO 2026-08-19 17:55:43,863 controller 19243 -- Importing and building app 'anthropic-direct'.
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:43,826 proxy 172.24.0.2 -- HAProxy started successfully.
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:43,859 proxy 172.24.0.2 -- Using HAProxy binary: /workspace/ray/.venv/lib/python3.12/site-packages/ray_haproxy/bin/haproxy
2026-08-19 17:55:43,869 SUCC scripts.py:537 -- Submitted deploy config successfully.
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:43,871 proxy 172.24.0.2 -- Starting HAProxy (spawn #2, pid=28237, stdout=/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock.28089.2.stdout.log, stderr=/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock.28089.2.stderr.log); args=['/workspace/ray/.venv/lib/python3.12/site-packages/ray_haproxy/bin/haproxy', '-db', '-f', '/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/haproxy.cfg', '-dR', '-sf', '28225', '-x', '/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock']
(HAProxyManager pid=28089) INFO 2026-08-19 17:55:44,374 proxy 172.24.0.2 -- Successfully performed graceful HAProxy reload with process restart.
(build_serve_application pid=28238) INFO 2026-08-19 17:55:48,349 controller build_anthropic-direct_28238 -- Importing application 'anthropic-direct' with arguments {'llm_configs': [{'model_loading_config': {'model_id': 'claude-sonnet-4-5-20250929', 'model_source': 'Qwen/Qwen3-8B'}, 'deployment_config': {'autoscaling_config': {'min_replicas': 1, 'max_replicas': 1}}, 'engine_kwargs': {'enable_auto_tool_choice': True, 'tool_call_parser': 'hermes', 'reasoning_parser': 'qwen3', 'hf_overrides': {'rope_scaling': {'rope_type': 'yarn', 'factor': 4.0, 'original_max_position_embeddings': 32768}}, 'max_model_len': 131072, 'gpu_memory_utilization': 0.9, 'tensor_parallel_size': 1, 'enable_prefix_caching': True}, 'runtime_env': {'env_vars': {'HF_TOKEN': '', 'VLLM_DISABLE_COMPILE_CACHE': '1'}}}]}.
(build_serve_application pid=28238) /workspace/ray/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py:61: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
(build_serve_application pid=28238) import pynvml # type: ignore[import]
(build_serve_application pid=28238) INFO 2026-08-19 17:56:33,887 controller build_anthropic-direct_28238 -- ============== Deployment Options ==============
(build_serve_application pid=28238) INFO 2026-08-19 17:56:33,888 controller build_anthropic-direct_28238 -- {'autoscaling_config': {'max_replicas': 1,
(build_serve_application pid=28238) 'min_replicas': 1,
(build_serve_application pid=28238) 'target_ongoing_requests': 1000000000},
(build_serve_application pid=28238) 'health_check_period_s': 10,
(build_serve_application pid=28238) 'health_check_timeout_s': 10,
(build_serve_application pid=28238) 'max_ongoing_requests': 1000000000,
(build_serve_application pid=28238) 'name': 'LLMServer:claude-sonnet-4-5-20250929',
(build_serve_application pid=28238) 'placement_group_bundles': [{'CPU': 1, 'GPU': 1}],
(build_serve_application pid=28238) 'placement_group_strategy': 'PACK',
(build_serve_application pid=28238) 'ray_actor_options': {'runtime_env': {'env_vars': {'HF_TOKEN': '',
(build_serve_application pid=28238) 'VLLM_DISABLE_COMPILE_CACHE': '1'},
(build_serve_application pid=28238) 'worker_process_setup_hook': 'ray.llm._internal.serve._worker_process_setup_hook'}},
(build_serve_application pid=28238) 'request_router_config': RequestRouterConfig(request_router_class='ray.serve.experimental.round_robin_router.RoundRobinRouter', request_router_kwargs={}, request_routing_stats_period_s=10, request_routing_stats_timeout_s=30, initial_backoff_s=0.025, backoff_multiplier=2, max_backoff_s=0.5)}
(build_serve_application pid=28238) INFO 2026-08-19 17:56:33,900 controller build_anthropic-direct_28238 -- Direct streaming enabled: LLMServer=ingress, LLMRouter=ingress_request_router
(ServeController pid=19243) INFO 2026-08-19 17:56:34,028 controller 19243 -- Imported and built app 'anthropic-direct' successfully.
(ServeController pid=19243) INFO 2026-08-19 17:56:34,029 controller 19243 -- Raising graceful_shutdown_timeout_s for ingress deployment 'LLMServer:claude-sonnet-4-5-20250929' from 20.0s to 35.0s so the force-kill deadline covers the direct-ingress drain period.
(ServeController pid=19243) INFO 2026-08-19 17:56:34,030 controller 19243 -- Application 'anthropic-direct' has ingress request router deployment 'LLMRouter' configured.
(ServeController pid=19243) INFO 2026-08-19 17:56:34,031 controller 19243 -- Registering autoscaling state for deployment Deployment(name='LLMServer:claude-sonnet-4-5-20250929', app='anthropic-direct')
(ServeController pid=19243) INFO 2026-08-19 17:56:34,031 controller 19243 -- Deploying new version of Deployment(name='LLMServer:claude-sonnet-4-5-20250929', app='anthropic-direct') (initial target replicas: 1).
(ServeController pid=19243) INFO 2026-08-19 17:56:34,032 controller 19243 -- Deregistering autoscaling state for deployment Deployment(name='LLMRouter', app='anthropic-direct')
(ServeController pid=19243) WARNING 2026-08-19 17:56:34,032 controller 19243 -- Cannot deregister autoscaling state for deployment Deployment(name='LLMRouter', app='anthropic-direct') because it is not registered
(ServeController pid=19243) INFO 2026-08-19 17:56:34,033 controller 19243 -- Deploying new version of Deployment(name='LLMRouter', app='anthropic-direct') (initial target replicas: 0).
(ProxyActor pid=28085) INFO 2026-08-19 17:56:34,036 proxy 172.24.0.2 -- Got updated endpoints: {Deployment(name='LLMServer:claude-sonnet-4-5-20250929', app='anthropic-direct'): EndpointInfo(route='/', app_is_cross_language=False, route_patterns=None)}.
(ProxyActor pid=28085) INFO 2026-08-19 17:56:34,041 proxy 172.24.0.2 -- Started <ray.serve._private.router.SharedRouterLongPollClient object at 0x7f4009366de0>.
(ServeController pid=19243) INFO 2026-08-19 17:56:34,137 controller 19243 -- Adding 1 replica to Deployment(name='LLMServer:claude-sonnet-4-5-20250929', app='anthropic-direct').
(ServeController pid=19243) INFO 2026-08-19 17:56:34,139 controller 19243 -- Adding 1 replica to Deployment(name='LLMRouter', app='anthropic-direct').
(HAProxyManager pid=28089) INFO 2026-08-19 17:56:34,138 proxy 172.24.0.2 -- Got updated backend configs: [BackendConfig(app_name='anthropic-direct', name='http-anthropic-direct', path_prefix='/', servers=[], ingress_request_router_servers=[], fallback_server=ServerConfig(name='SERVE_PROXY_ACTOR-fallback-458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02', host='127.0.0.1', port=8500), protocol=HTTP)].
(HAProxyManager pid=28089) INFO 2026-08-19 17:56:34,172 proxy 172.24.0.2 -- Using HAProxy binary: /workspace/ray/.venv/lib/python3.12/site-packages/ray_haproxy/bin/haproxy
(HAProxyManager pid=28089) INFO 2026-08-19 17:56:34,184 proxy 172.24.0.2 -- Starting HAProxy (spawn #3, pid=28489, stdout=/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock.28089.3.stdout.log, stderr=/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock.28089.3.stderr.log); args=['/workspace/ray/.venv/lib/python3.12/site-packages/ray_haproxy/bin/haproxy', '-db', '-f', '/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/haproxy.cfg', '-dR', '-sf', '28237', '-x', '/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock']
(HAProxyManager pid=28089) INFO 2026-08-19 17:56:34,687 proxy 172.24.0.2 -- Successfully performed graceful HAProxy reload with process restart.
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 17:56:37,858 anthropic-direct_LLMRouter the5croz -- Started <ray.serve._private.router.SharedRouterLongPollClient object at 0x7f647c56fc20>.
(ServeController pid=19243) INFO 2026-08-19 17:56:37,961 controller 19243 -- Creating node manager for node 458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02
(ServeController pid=19243) INFO 2026-08-19 17:56:37,961 controller 19243 -- Allocated RequestProtocol.HTTP port 30000 to replica the5croz on node 458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 17:56:37,962 anthropic-direct_LLMRouter the5croz -- Allocated port 30000 for RequestProtocol.HTTP
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 17:56:37,963 anthropic-direct_LLMRouter the5croz -- Successfully started RequestProtocol.HTTP server on port 30000
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 17:56:37,963 anthropic-direct_LLMRouter the5croz -- Started HTTP server on port 30000
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) /workspace/ray/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py:61: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) import pynvml # type: ignore[import]
(ServeController pid=19243) WARNING 2026-08-19 17:57:04,222 controller 19243 -- Deployment 'LLMServer:claude-sonnet-4-5-20250929' in application 'anthropic-direct' has 1 replicas that have taken more than 30s to be scheduled. This may be due to waiting for the cluster to auto-scale or for a runtime environment to be installed. Resources required for each replica: [{"GPU": 1.0, "CPU": 1.0}], total resources available: {}. Use `ray status` for more details.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 17:57:14,817 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn -- Running tasks to download model files on worker nodes
(pid=28745) /workspace/ray/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py:61: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
(pid=28745) import pynvml # type: ignore[import]
(ServeController pid=19243) WARNING 2026-08-19 17:57:34,299 controller 19243 -- Deployment 'LLMServer:claude-sonnet-4-5-20250929' in application 'anthropic-direct' has 1 replicas that have taken more than 30s to initialize.
(ServeController pid=19243) This may be caused by a slow __init__ or reconfigure method.
(initialize_remote_node pid=28745) No cloud storage mirror configured
(ServeController pid=19243) WARNING 2026-08-19 17:58:04,383 controller 19243 -- Deployment 'LLMServer:claude-sonnet-4-5-20250929' in application 'anthropic-direct' has 1 replicas that have taken more than 30s to initialize.
(ServeController pid=19243) This may be caused by a slow __init__ or reconfigure method.
(_get_vllm_engine_config pid=28745) INFO 08-19 17:58:05 [model.py:623] Resolved architecture: Qwen3ForCausalLM
(_get_vllm_engine_config pid=28745) INFO 08-19 17:58:05 [model.py:1788] Using max model len 131072
(_get_vllm_engine_config pid=28745) INFO 08-19 17:58:05 [arg_utils.py:1951] Using ray runtime env (env vars redacted): {'env_vars': {'HF_TOKEN': '***', 'VLLM_DISABLE_COMPILE_CACHE': '***'}, 'worker_process_setup_hook': 'ray.llm._internal.serve._worker_process_setup_hook'}
(_get_vllm_engine_config pid=28745) INFO 08-19 17:58:05 [scheduler.py:252] Chunked prefill is enabled with max_num_batched_tokens=8192.
(_get_vllm_engine_config pid=28745) INFO 08-19 17:58:05 [vllm.py:1109] Asynchronous scheduling is enabled.
(_get_vllm_engine_config pid=28745) INFO 08-19 17:58:05 [kernel.py:295] Final IR op priority after setting platform defaults: IrOpPriorityConfig(rms_norm=['native'], fused_add_rms_norm=['native'])
(_get_vllm_engine_config pid=28745) WARNING 08-19 17:58:05 [vllm.py:2228] Model Runner V2 does not yet support the thinking_token_budget request parameter. Set VLLM_USE_V2_MODEL_RUNNER=0 if this is required.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 17:58:07,052 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn -- Clearing the current platform cache ...
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 17:58:07,335 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn -- Using executor class: <class 'vllm.v1.executor.ray_executor_v2.RayExecutorV2'>
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) WARNING 08-19 17:58:10 [system_utils.py:157] We must use the `spawn` multiprocessing start method. Overriding VLLM_WORKER_MULTIPROC_METHOD to 'spawn'. See https://docs.vllm.ai/en/latest/usage/troubleshooting.html#python-multiprocessing for more information. Reasons: In a Ray actor and can only be spawned
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) /workspace/ray/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py:61: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) import pynvml # type: ignore[import]
(ServeController pid=19243) WARNING 2026-08-19 17:58:34,385 controller 19243 -- Deployment 'LLMServer:claude-sonnet-4-5-20250929' in application 'anthropic-direct' has 1 replicas that have taken more than 30s to initialize.
(ServeController pid=19243) This may be caused by a slow __init__ or reconfigure method.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) INFO 08-19 17:58:55 [core.py:116] Initializing a V1 LLM engine (v0.26.0) with config: model='Qwen/Qwen3-8B', speculative_config=None, tokenizer='Qwen/Qwen3-8B', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=131072, download_dir=None, load_format=auto, tensor_parallel_size=1, pipeline_parallel_size=1, data_parallel_size=1, decode_context_parallel_size=1, dcp_comm_backend=ag_rs, disable_custom_all_reduce=False, quantization=None, quantization_config=None, enforce_eager=False, enable_return_routed_experts=False, kv_cache_dtype=auto, device_config=cuda, structured_outputs_config=StructuredOutputsConfig(backend='auto', disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser='qwen3', reasoning_parser_plugin='', enable_in_reasoning=False), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None, kv_cache_metrics=False, kv_cache_metrics_sample=0.01, cudagraph_metrics=False, enable_layerwise_nvtx_tracing=False, enable_mfu_metrics=False, enable_mm_processor_stats=False, enable_logging_iteration_details=False, jit_monitor_mode='warn', jit_monitor_verbose=False), seed=0, served_model_name=claude-sonnet-4-5-20250929, enable_prefix_caching=True, enable_chunked_prefill=True, pooler_config=None, compilation_config={'mode': <CompilationMode.VLLM_COMPILE: 3>, 'debug_dump_path': None, 'cache_dir': '', 'compile_cache_save_format': 'binary', 'backend': 'inductor', 'custom_ops': ['none'], 'ir_enable_torch_wrap': True, 'splitting_ops': ['vllm::unified_attention_with_output', 'vllm::unified_mla_attention_with_output', 'vllm::mamba_mixer2', 'vllm::mamba_mixer', 'vllm::short_conv', 'vllm::linear_attention', 'vllm::plamo2_mamba_mixer', 'vllm::qwen_gdn_attention_core', 'vllm::gdn_attention_core_xpu', 'vllm::olmo_hybrid_gdn_full_forward', 'vllm::kda_attention', 'vllm::sparse_attn_indexer', 'vllm::rocm_aiter_sparse_attn_indexer', 'vllm::deepseek_v4_attention', 'vllm::hpc_rope_norm_forward', 'vllm::unified_kv_cache_update', 'vllm::unified_mla_kv_cache_update'], 'compile_mm_encoder': False, 'cudagraph_mm_encoder': False, 'encoder_cudagraph_token_budgets': [], 'encoder_cudagraph_max_vision_items_per_batch': 0, 'encoder_cudagraph_max_frames_per_batch': None, 'compile_sizes': [], 'compile_ranges_endpoints': [8192], 'inductor_compile_config': {'enable_auto_functionalized_v2': False, 'size_asserts': False, 'alignment_asserts': False, 'scalar_asserts': False, 'combo_kernels': True, 'benchmark_combo_kernel': True}, 'inductor_passes': {}, 'cudagraph_mode': <CUDAGraphMode.FULL_AND_PIECEWISE: (2, 1)>, 'cudagraph_num_of_warmups': 1, 'cudagraph_capture_sizes': [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496, 512], 'cudagraph_copy_inputs': False, 'cudagraph_specialize_lora': True, 'use_inductor_graph_partition': False, 'pass_config': {'fuse_norm_quant': False, 'fuse_act_quant': False, 'fuse_attn_quant': False, 'enable_sp': False, 'fuse_gemm_comms': False, 'fuse_allreduce_rms': False, 'enable_qk_norm_rope_fusion': False, 'fuse_rope_kvcache_cat_mla': False, 'fuse_act_padding': False, 'fuse_qk_norm_rope_kvcache': False}, 'max_cudagraph_capture_size': 512, 'dynamic_shapes_config': {'type': <DynamicShapesType.BACKED: 'backed'>, 'evaluate_guards': False, 'assume_32_bit_indexing': False}, 'local_cache_dir': None, 'fast_moe_cold_start': False, 'static_all_moe_layers': []}, kernel_config=KernelConfig(ir_op_priority=IrOpPriorityConfig(rms_norm=['native'], fused_add_rms_norm=['native']), enable_flashinfer_autotune=True, enable_cutedsl_warmup=True, enable_bf16x3_router_gemm=False, moe_backend='auto', linear_backend='auto')
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) INFO 08-19 17:58:55 [ray_utils.py:602] Using the existing placement group
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) 2026-08-19 17:58:55,615 INFO worker.py:1683 -- Using address 172.24.0.2:6379 set in the environment variable RAY_ADDRESS
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) 2026-08-19 17:58:55,622 INFO worker.py:1833 -- Connecting to existing Ray cluster at address: 172.24.0.2:6379...
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) 2026-08-19 17:58:55,633 INFO worker.py:2024 -- Connected to Ray cluster.
(pid=29271) /workspace/ray/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py:61: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
(pid=29271) import pynvml # type: ignore[import]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (pid=29271) /workspace/ray/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py:61: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (pid=29271) import pynvml # type: ignore[import]
(ServeController pid=19243) WARNING 2026-08-19 17:59:04,465 controller 19243 -- Deployment 'LLMServer:claude-sonnet-4-5-20250929' in application 'anthropic-direct' has 1 replicas that have taken more than 30s to initialize.
(ServeController pid=19243) This may be caused by a slow __init__ or reconfigure method.
(ServeController pid=19243) WARNING 2026-08-19 17:59:34,503 controller 19243 -- Deployment 'LLMServer:claude-sonnet-4-5-20250929' in application 'anthropic-direct' has 1 replicas that have taken more than 30s to initialize.
(ServeController pid=19243) This may be caused by a slow __init__ or reconfigure method.
(RayWorkerProc pid=29271) WARNING 08-19 17:59:45 [worker_base.py:306] Missing `shared_worker_lock` argument from executor. This argument is needed for mm_processor_cache_type='shm'.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) WARNING 08-19 17:59:45 [worker_base.py:306] Missing `shared_worker_lock` argument from executor. This argument is needed for mm_processor_cache_type='shm'.
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:45 [parallel_state.py:1615] world_size=1 rank=0 local_rank=0 distributed_init_method=tcp://172.24.0.2:100 backend=nccl
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:45 [parallel_state.py:1946] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, PCP rank 0, TP rank 0, EP rank N/A, EPLB rank N/A
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:45 [gpu_worker.py:378] Using V2 Model Runner
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:45 [parallel_state.py:1615] world_size=1 rank=0 local_rank=0 distributed_init_method=tcp://172.24.0.2:100 backend=nccl
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:45 [parallel_state.py:1946] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, PCP rank 0, TP rank 0, EP rank N/A, EPLB rank N/A
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:45 [gpu_worker.py:378] Using V2 Model Runner
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:46 [model_runner.py:284] Loading model from scratch...
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:46 [model_runner.py:284] Loading model from scratch...
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:47 [cuda.py:482] Using FLASH_ATTN attention backend out of potential backends: ['FLASH_ATTN', 'FLASHINFER', 'TRITON_ATTN', 'FLEX_ATTENTION'].
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:47 [flash_attn.py:776] Using FlashAttention version 3
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:47 [cuda.py:482] Using FLASH_ATTN attention backend out of potential backends: ['FLASH_ATTN', 'FLASHINFER', 'TRITON_ATTN', 'FLEX_ATTENTION'].
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:47 [flash_attn.py:776] Using FlashAttention version 3
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:48 [weight_utils.py:869] Filesystem type for checkpoints: NFS4. Checkpoint size: 15.26 GiB. Available RAM: 1851.51 GiB.
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:48 [weight_utils.py:831] Prefetching checkpoint files into page cache started (in background, num_threads=8, block_size=16777216 bytes)
Loading safetensors checkpoint shards: 0% Completed | 0/5 [00:00<?, ?it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:48 [weight_utils.py:869] Filesystem type for checkpoints: NFS4. Checkpoint size: 15.26 GiB. Available RAM: 1851.51 GiB.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:48 [weight_utils.py:831] Prefetching checkpoint files into page cache started (in background, num_threads=8, block_size=16777216 bytes)
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Loading safetensors checkpoint shards: 0% Completed | 0/5 [00:00<?, ?it/s]
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:50 [weight_utils.py:803] Prefetching checkpoint files: 10% (1/5)
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:50 [weight_utils.py:803] Prefetching checkpoint files: 10% (1/5)
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:50 [weight_utils.py:803] Prefetching checkpoint files: 20% (2/5)
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:50 [weight_utils.py:803] Prefetching checkpoint files: 20% (2/5)
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:50 [weight_utils.py:803] Prefetching checkpoint files: 30% (3/5)
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:50 [weight_utils.py:803] Prefetching checkpoint files: 30% (3/5)
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:50 [weight_utils.py:803] Prefetching checkpoint files: 40% (4/5)
Loading safetensors checkpoint shards: 20% Completed | 1/5 [00:02<00:09, 2.37s/it]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:50 [weight_utils.py:803] Prefetching checkpoint files: 40% (4/5)
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Loading safetensors checkpoint shards: 20% Completed | 1/5 [00:02<00:09, 2.37s/it]
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:51 [weight_utils.py:803] Prefetching checkpoint files: 50% (5/5)
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:51 [weight_utils.py:826] Prefetching checkpoint files into page cache finished in 2.57s
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:51 [weight_utils.py:803] Prefetching checkpoint files: 50% (5/5)
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:51 [weight_utils.py:826] Prefetching checkpoint files into page cache finished in 2.57s
Loading safetensors checkpoint shards: 40% Completed | 2/5 [00:03<00:04, 1.38s/it]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Loading safetensors checkpoint shards: 40% Completed | 2/5 [00:03<00:04, 1.38s/it]
Loading safetensors checkpoint shards: 60% Completed | 3/5 [00:03<00:02, 1.06s/it]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Loading safetensors checkpoint shards: 60% Completed | 3/5 [00:03<00:02, 1.06s/it]
Loading safetensors checkpoint shards: 80% Completed | 4/5 [00:04<00:00, 1.16it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Loading safetensors checkpoint shards: 80% Completed | 4/5 [00:04<00:00, 1.16it/s]
Loading safetensors checkpoint shards: 100% Completed | 5/5 [00:04<00:00, 1.53it/s]
Loading safetensors checkpoint shards: 100% Completed | 5/5 [00:04<00:00, 1.09it/s]
(RayWorkerProc pid=29271) (Worker pid=29271)
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Loading safetensors checkpoint shards: 100% Completed | 5/5 [00:04<00:00, 1.53it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Loading safetensors checkpoint shards: 100% Completed | 5/5 [00:04<00:00, 1.09it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271)
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:53 [default_loader.py:430] Loading weights took 4.62 seconds
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:53 [default_loader.py:430] Loading weights took 4.62 seconds
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:53 [model_runner.py:305] Model loading took 15.31 GiB and 7.150317 seconds
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:53 [topk_topp_sampler.py:55] Using FlashInfer for top-p & top-k sampling.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:53 [model_runner.py:305] Model loading took 15.31 GiB and 7.150317 seconds
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 17:59:53 [topk_topp_sampler.py:55] Using FlashInfer for top-p & top-k sampling.
(ServeController pid=19243) WARNING 2026-08-19 18:00:04,537 controller 19243 -- Deployment 'LLMServer:claude-sonnet-4-5-20250929' in application 'anthropic-direct' has 1 replicas that have taken more than 30s to initialize.
(ServeController pid=19243) This may be caused by a slow __init__ or reconfigure method.
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:06 [backends.py:1092] vLLM's torch.compile cache is disabled.
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:06 [backends.py:1155] Dynamo bytecode transform time: 12.74 s
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:06 [backends.py:1092] vLLM's torch.compile cache is disabled.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:06 [backends.py:1155] Dynamo bytecode transform time: 12.74 s
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:12 [backends.py:393] Compiling a graph for compile range (1, 8192) takes 5.20 s
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:12 [backends.py:393] Compiling a graph for compile range (1, 8192) takes 5.20 s
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:13 [monitor.py:53] torch.compile and initial profiling/warmup run together took 19.48 s in total
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:13 [monitor.py:53] torch.compile and initial profiling/warmup run together took 19.48 s in total
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) INFO 08-19 18:00:14 [kv_cache_utils.py:2177] GPU KV cache size: 396,448 tokens
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) INFO 08-19 18:00:14 [kv_cache_utils.py:2178] Maximum concurrency for 131,072 tokens per request: 3.02x
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:14 [gpu_worker.py:560] Available KV cache memory: 54.45 GiB
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:14 [gpu_worker.py:560] Available KV cache memory: 54.45 GiB
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:14 [kernel_warmup.py:227] Using FlashInfer autotune cache file: /root/.cache/vllm/flashinfer_autotune_cache/0.6.14/90a/41ab9f40faa847c095d7bbd5b2b2c160d7a475f07dca476ed31a048a4e8d8764/autotune_configs.json
(RayWorkerProc pid=29271) (Worker pid=29271) WARNING 08-19 18:00:14 [kernel_warmup.py:258] No FlashInfer autotune cache entries found.Falling back to default tactics.
(RayWorkerProc pid=29271) (Worker pid=29271) 2026-08-19 18:00:14,819 - INFO - autotuner.py:651 - flashinfer.jit: [Autotuner]: Autotuning process starts ...
(RayWorkerProc pid=29271) (Worker pid=29271) 2026-08-19 18:00:14,841 - INFO - autotuner.py:674 - flashinfer.jit: [Autotuner]: Autotuning process ends
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:14 [kernel_warmup.py:227] Using FlashInfer autotune cache file: /root/.cache/vllm/flashinfer_autotune_cache/0.6.14/90a/41ab9f40faa847c095d7bbd5b2b2c160d7a475f07dca476ed31a048a4e8d8764/autotune_configs.json
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) WARNING 08-19 18:00:14 [kernel_warmup.py:258] No FlashInfer autotune cache entries found.Falling back to default tactics.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) 2026-08-19 18:00:14,819 - INFO - autotuner.py:651 - flashinfer.jit: [Autotuner]: Autotuning process starts ...
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) 2026-08-19 18:00:14,841 - INFO - autotuner.py:674 - flashinfer.jit: [Autotuner]: Autotuning process ends
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:14 [kernel_warmup.py:65] Warming up ll_bf16 router GEMM kernels.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:14 [kernel_warmup.py:65] Warming up ll_bf16 router GEMM kernels.
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:23 [cutedsl_warmup.py:101] Skipping CuTeDSL warmup because no compile units were requested.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:23 [cutedsl_warmup.py:101] Skipping CuTeDSL warmup because no compile units were requested.
Capturing CUDA graphs (PIECEWISE): 0%| | 0/51 [00:00<?, ?it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 0%| | 0/51 [00:00<?, ?it/s]
Capturing CUDA graphs (PIECEWISE): 6%|▌ | 3/51 [00:00<00:01, 28.83it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 6%|▌ | 3/51 [00:00<00:01, 28.83it/s]
Capturing CUDA graphs (PIECEWISE): 12%|█▏ | 6/51 [00:00<00:01, 29.03it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 12%|█▏ | 6/51 [00:00<00:01, 29.03it/s]
Capturing CUDA graphs (PIECEWISE): 18%|█▊ | 9/51 [00:00<00:01, 28.34it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 18%|█▊ | 9/51 [00:00<00:01, 28.34it/s]
Capturing CUDA graphs (PIECEWISE): 24%|██▎ | 12/51 [00:00<00:01, 28.86it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 24%|██▎ | 12/51 [00:00<00:01, 28.86it/s]
Capturing CUDA graphs (PIECEWISE): 29%|██▉ | 15/51 [00:00<00:01, 28.72it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 29%|██▉ | 15/51 [00:00<00:01, 28.72it/s]
Capturing CUDA graphs (PIECEWISE): 37%|███▋ | 19/51 [00:00<00:01, 29.78it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 37%|███▋ | 19/51 [00:00<00:01, 29.78it/s]
Capturing CUDA graphs (PIECEWISE): 43%|████▎ | 22/51 [00:00<00:00, 29.59it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 43%|████▎ | 22/51 [00:00<00:00, 29.59it/s]
Capturing CUDA graphs (PIECEWISE): 49%|████▉ | 25/51 [00:00<00:00, 29.65it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 49%|████▉ | 25/51 [00:00<00:00, 29.65it/s]
Capturing CUDA graphs (PIECEWISE): 57%|█████▋ | 29/51 [00:00<00:00, 29.79it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 57%|█████▋ | 29/51 [00:00<00:00, 29.79it/s]
Capturing CUDA graphs (PIECEWISE): 63%|██████▎ | 32/51 [00:01<00:00, 29.73it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 63%|██████▎ | 32/51 [00:01<00:00, 29.73it/s]
Capturing CUDA graphs (PIECEWISE): 69%|██████▊ | 35/51 [00:01<00:00, 28.92it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 69%|██████▊ | 35/51 [00:01<00:00, 28.92it/s]
Capturing CUDA graphs (PIECEWISE): 75%|███████▍ | 38/51 [00:01<00:00, 28.15it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 75%|███████▍ | 38/51 [00:01<00:00, 28.15it/s]
Capturing CUDA graphs (PIECEWISE): 80%|████████ | 41/51 [00:01<00:00, 27.66it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 80%|████████ | 41/51 [00:01<00:00, 27.66it/s]
Capturing CUDA graphs (PIECEWISE): 86%|████████▋ | 44/51 [00:01<00:00, 27.13it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 86%|████████▋ | 44/51 [00:01<00:00, 27.13it/s]
Capturing CUDA graphs (PIECEWISE): 92%|█████████▏| 47/51 [00:01<00:00, 27.06it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 92%|█████████▏| 47/51 [00:01<00:00, 27.06it/s]
Capturing CUDA graphs (PIECEWISE): 100%|██████████| 51/51 [00:01<00:00, 28.63it/s]
Capturing CUDA graphs (FULL): 0%| | 0/51 [00:00<?, ?it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (PIECEWISE): 100%|██████████| 51/51 [00:01<00:00, 28.63it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 0%| | 0/51 [00:00<?, ?it/s]
Capturing CUDA graphs (FULL): 8%|▊ | 4/51 [00:00<00:01, 32.40it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 8%|▊ | 4/51 [00:00<00:01, 32.40it/s]
Capturing CUDA graphs (FULL): 16%|█▌ | 8/51 [00:00<00:01, 33.90it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 16%|█▌ | 8/51 [00:00<00:01, 33.90it/s]
Capturing CUDA graphs (FULL): 24%|██▎ | 12/51 [00:00<00:01, 35.26it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 24%|██▎ | 12/51 [00:00<00:01, 35.26it/s]
Capturing CUDA graphs (FULL): 31%|███▏ | 16/51 [00:00<00:00, 36.95it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 31%|███▏ | 16/51 [00:00<00:00, 36.95it/s]
Capturing CUDA graphs (FULL): 41%|████ | 21/51 [00:00<00:00, 38.29it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 41%|████ | 21/51 [00:00<00:00, 38.29it/s]
Capturing CUDA graphs (FULL): 51%|█████ | 26/51 [00:00<00:00, 39.10it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 51%|█████ | 26/51 [00:00<00:00, 39.10it/s]
Capturing CUDA graphs (FULL): 59%|█████▉ | 30/51 [00:00<00:00, 39.27it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 59%|█████▉ | 30/51 [00:00<00:00, 39.27it/s]
Capturing CUDA graphs (FULL): 67%|██████▋ | 34/51 [00:00<00:00, 31.50it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 67%|██████▋ | 34/51 [00:00<00:00, 31.50it/s]
Capturing CUDA graphs (FULL): 75%|███████▍ | 38/51 [00:01<00:00, 33.58it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 75%|███████▍ | 38/51 [00:01<00:00, 33.58it/s]
Capturing CUDA graphs (FULL): 82%|████████▏ | 42/51 [00:01<00:00, 35.25it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 82%|████████▏ | 42/51 [00:01<00:00, 35.25it/s]
Capturing CUDA graphs (FULL): 92%|█████████▏| 47/51 [00:01<00:00, 37.11it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 92%|█████████▏| 47/51 [00:01<00:00, 37.11it/s]
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:26 [model_runner.py:747] Graph capturing finished in 4 secs, took 1.00 GiB
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:26 [gpu_worker.py:857] Free memory on device (78.66/79.18 GiB) on startup. Desired GPU memory utilization is (0.9, 71.26 GiB). Actual usage is 15.31 GiB for weight, 1.29 GiB for peak activation, 0.22 GiB for non-torch memory, and 1.0 GiB for CUDAGraph memory. Replace gpu_memory_utilization config with `--kv-cache-memory=57229567898` (53.3 GiB) to fit into requested memory, or `--kv-cache-memory=65178914304` (60.7 GiB) to fully utilize gpu memory. Current kv cache memory in use is 54.45 GiB.
Capturing CUDA graphs (FULL): 100%|██████████| 51/51 [00:01<00:00, 36.46it/s]
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:26 [model_runner.py:747] Graph capturing finished in 4 secs, took 1.00 GiB
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:26 [gpu_worker.py:857] Free memory on device (78.66/79.18 GiB) on startup. Desired GPU memory utilization is (0.9, 71.26 GiB). Actual usage is 15.31 GiB for weight, 1.29 GiB for peak activation, 0.22 GiB for non-torch memory, and 1.0 GiB for CUDAGraph memory. Replace gpu_memory_utilization config with `--kv-cache-memory=57229567898` (53.3 GiB) to fit into requested memory, or `--kv-cache-memory=65178914304` (60.7 GiB) to fully utilize gpu memory. Current kv cache memory in use is 54.45 GiB.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087Capturing CUDA graphs (FULL): 100%|██████████| 51/51 [00:01<00:00, 36.46it/s]
(RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:29 [jit_monitor.py:79] Kernel JIT monitor activated; monitored JIT compilations during inference will use mode=warn.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) (RayWorkerProc pid=29271) (Worker pid=29271) INFO 08-19 18:00:29 [jit_monitor.py:79] Kernel JIT monitor activated; monitored JIT compilations during inference will use mode=warn.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) INFO 08-19 18:00:30 [core.py:340] init engine (profile, create kv cache, warmup model) took 36.54 s (compilation: 19.48 s)
(ServeController pid=19243) WARNING 2026-08-19 18:00:34,543 controller 19243 -- Deployment 'LLMServer:claude-sonnet-4-5-20250929' in application 'anthropic-direct' has 1 replicas that have taken more than 30s to initialize.
(ServeController pid=19243) This may be caused by a slow __init__ or reconfigure method.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) INFO 08-19 18:00:48 [vllm.py:1109] Asynchronous scheduling is enabled.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) INFO 08-19 18:00:48 [kernel.py:295] Final IR op priority after setting platform defaults: IrOpPriorityConfig(rms_norm=['native'], fused_add_rms_norm=['native'])
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) (EngineCore pid=29087) WARNING 08-19 18:00:48 [vllm.py:2228] Model Runner V2 does not yet support the thinking_token_budget request parameter. Set VLLM_USE_V2_MODEL_RUNNER=0 if this is required.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:00:48 [parser_manager.py:37] "auto" tool choice has been enabled.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) WARNING 08-19 18:00:48 [model.py:1546] Default vLLM sampling parameters have been overridden by the model's `generation_config.json`: `{'temperature': 0.6, 'top_k': 20, 'top_p': 0.95}`. If this is not intended, please relaunch vLLM instance with `--generation-config vllm`.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:00:50 [hf.py:540] Detected the chat template content format to be 'string'. You can set `--chat-template-content-format` to override this.
(TelemetryAgent pid=22751) INFO 2026-08-19 18:00:51,088 serve 22751 -- The cached controller has died or is unreachable: The actor died unexpectedly before finishing this task.
(TelemetryAgent pid=22751) class_name: ServeController
(TelemetryAgent pid=22751) actor_id: 06d23f829656cc71a3322d9a01000000
(TelemetryAgent pid=22751) pid: 19237
(TelemetryAgent pid=22751) name: SERVE_CONTROLLER_ACTOR
(TelemetryAgent pid=22751) namespace: serve
(TelemetryAgent pid=22751) ip: 172.24.0.2
(TelemetryAgent pid=22751) The actor is dead because it was killed by `ray.kill`..
(TelemetryAgent pid=22751) INFO 2026-08-19 18:00:51,088 serve 22751 -- Nothing to shut down. There's no Serve application running on this Ray cluster.
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:00:51,080 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn -- Started vLLM engine.
(ServeController pid=19243) INFO 2026-08-19 18:00:52,619 controller 19243 -- Allocated RequestProtocol.HTTP port 30001 to replica d2ngfytn on node 458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:00:52,620 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn -- Allocated port 30001 for RequestProtocol.HTTP
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:00:52,620 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn -- Successfully started RequestProtocol.HTTP server on port 30001
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:00:52,620 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn -- Started HTTP server on port 30001
(ProxyActor pid=28085) INFO 2026-08-19 18:00:52,705 proxy 172.24.0.2 -- Got updated endpoints: {Deployment(name='LLMServer:claude-sonnet-4-5-20250929', app='anthropic-direct'): EndpointInfo(route='/', app_is_cross_language=False, route_patterns=[RoutePattern(methods=['POST'], path='/detokenize'), RoutePattern(methods=['GET', 'HEAD'], path='/docs'), RoutePattern(methods=['GET', 'HEAD'], path='/docs/oauth2-redirect'), RoutePattern(methods=['POST'], path='/generative_scoring'), RoutePattern(methods=['GET'], path='/health'), RoutePattern(methods=['POST'], path='/inference/v1/generate'), RoutePattern(methods=['POST'], path='/invocations'), RoutePattern(methods=['POST'], path='/is_scaling_elastic_ep'), RoutePattern(methods=['GET'], path='/load'), RoutePattern(methods=['GET'], path='/metrics'), RoutePattern(methods=['GET', 'HEAD'], path='/openapi.json'), RoutePattern(methods=['GET', 'POST'], path='/ping'), RoutePattern(methods=['GET', 'HEAD'], path='/redoc'), RoutePattern(methods=['POST'], path='/scale_elastic_ep'), RoutePattern(methods=['POST'], path='/tokenize'), RoutePattern(methods=['POST'], path='/v1/chat/completions'), RoutePattern(methods=['POST'], path='/v1/chat/completions/batch'), RoutePattern(methods=['POST'], path='/v1/chat/completions/derender'), RoutePattern(methods=['POST'], path='/v1/chat/completions/render'), RoutePattern(methods=['POST'], path='/v1/completions'), RoutePattern(methods=['POST'], path='/v1/completions/derender'), RoutePattern(methods=['POST'], path='/v1/completions/render'), RoutePattern(methods=['POST'], path='/v1/messages'), RoutePattern(methods=['POST'], path='/v1/messages/count_tokens'), RoutePattern(methods=['GET'], path='/v1/models'), RoutePattern(methods=['GET'], path='/v1/models/{model:path}'), RoutePattern(methods=['POST'], path='/v1/responses'), RoutePattern(methods=['GET'], path='/v1/responses/{response_id}'), RoutePattern(methods=['POST'], path='/v1/responses/{response_id}/cancel'), RoutePattern(methods=['GET'], path='/version')])}.
(HAProxyManager pid=28089) INFO 2026-08-19 18:00:52,807 proxy 172.24.0.2 -- Got updated backend configs: [BackendConfig(app_name='anthropic-direct', name='http-anthropic-direct', path_prefix='/', servers=[ServerConfig(name='SERVE_REPLICA_anthropic-direct-LLMServer_claude-sonnet-4-5-20250929-d2ngfytn', host='127.0.0.1', port=30001)], ingress_request_router_servers=[ServerConfig(name='SERVE_REPLICA_anthropic-direct-LLMRouter-the5croz', host='127.0.0.1', port=30000)], fallback_server=ServerConfig(name='SERVE_PROXY_ACTOR-fallback-458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02', host='127.0.0.1', port=8500), protocol=HTTP)].
(HAProxyManager pid=28089) INFO 2026-08-19 18:00:52,850 proxy 172.24.0.2 -- Using HAProxy binary: /workspace/ray/.venv/lib/python3.12/site-packages/ray_haproxy/bin/haproxy
(HAProxyManager pid=28089) INFO 2026-08-19 18:00:52,862 proxy 172.24.0.2 -- Starting HAProxy (spawn #4, pid=30030, stdout=/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock.28089.4.stdout.log, stderr=/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock.28089.4.stderr.log); args=['/workspace/ray/.venv/lib/python3.12/site-packages/ray_haproxy/bin/haproxy', '-db', '-f', '/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/haproxy.cfg', '-dR', '-sf', '28489', '-x', '/tmp/haproxy-serve/458b406f405b216f1957ecd79e1ef5562844f7859946a728042edf02/admin.sock']
(HAProxyManager pid=28089) INFO 2026-08-19 18:00:53,365 proxy 172.24.0.2 -- Successfully performed graceful HAProxy reload with process restart.
(ServeReplica:anthropic-direct:LLMRouter pid=28239) WARNING 2026-08-19 18:01:32,370 anthropic-direct_LLMRouter the5croz 3e847fa6-1f86-496f-a670-2464651d6a46 -- Could not derive a routing key from the request body. body_truncated=False. Falling back to load-balanced replica selection. A configured body-aware router such as PrefixCacheAffinityRouter cannot take effect for these requests. For truncated bodies, raise HAProxy's routing body limit.
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:01:32,371 anthropic-direct_LLMRouter the5croz 3e847fa6-1f86-496f-a670-2464651d6a46 -- POST __call__ 200 9.3ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:01:32 [loggers.py:310] Engine 000: Avg prompt throughput: 0.9 tokens/s, Avg generation throughput: 0.4 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:01:33,039 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn 3e847fa6-1f86-496f-a670-2464651d6a46 -- POST /v1/messages 200 667.2ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:01:42 [loggers.py:310] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 6.0 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:01:52 [loggers.py:310] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.0 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:02:02,652 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn 24421355-01e1-48d9-b016-7afb5098491d -- GET / 404 1.0ms
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:02:12,425 anthropic-direct_LLMRouter the5croz 4493b8e2-932a-41ee-8e0f-a4b45319596d -- POST __call__ 200 1.6ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:02:15,711 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn 4493b8e2-932a-41ee-8e0f-a4b45319596d -- POST /v1/messages 200 3285.7ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:02:22 [loggers.py:310] Engine 000: Avg prompt throughput: 3368.4 tokens/s, Avg generation throughput: 15.7 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:02:32,616 anthropic-direct_LLMRouter the5croz 920cf95a-5398-416d-a19a-8288decc7d03 -- POST __call__ 200 1.1ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:02:32 [loggers.py:310] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.0 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:02:32,815 anthropic-direct_LLMRouter the5croz dc6aa7a2-3730-4552-95ba-96bed59b6daf -- POST __call__ 200 1.1ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:02:37,409 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn 920cf95a-5398-416d-a19a-8288decc7d03 -- POST /v1/messages 200 4792.0ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:02:42 [loggers.py:310] Engine 000: Avg prompt throughput: 80.4 tokens/s, Avg generation throughput: 165.5 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.5%, Prefix cache hit rate: 49.4%
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:02:44,368 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn dc6aa7a2-3730-4552-95ba-96bed59b6daf -- POST /v1/messages 200 11552.1ms
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:02:47,770 anthropic-direct_LLMRouter the5croz eb45f826-3872-415b-93a5-5be0abd3feb4 -- POST __call__ 200 1.0ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:02:48,665 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn eb45f826-3872-415b-93a5-5be0abd3feb4 -- POST /v1/messages 200 895.2ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:02:52 [loggers.py:310] Engine 000: Avg prompt throughput: 9.0 tokens/s, Avg generation throughput: 29.6 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 66.2%
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:02:56,524 anthropic-direct_LLMRouter the5croz 6bfc465f-2c52-4b3c-bd50-974a157306cc -- POST __call__ 200 1.0ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:03:00,567 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn 6bfc465f-2c52-4b3c-bd50-974a157306cc -- POST /v1/messages 200 4042.2ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:03:02 [loggers.py:310] Engine 000: Avg prompt throughput: 21.5 tokens/s, Avg generation throughput: 41.5 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 74.5%
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:03:08,248 anthropic-direct_LLMRouter the5croz c088317c-581b-4dfb-a3be-33dbb8defadb -- POST __call__ 200 1.6ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:03:12,092 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn c088317c-581b-4dfb-a3be-33dbb8defadb -- POST /v1/messages 200 3843.7ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:03:12 [loggers.py:310] Engine 000: Avg prompt throughput: 6.6 tokens/s, Avg generation throughput: 39.0 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 79.6%
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:03:22 [loggers.py:310] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.0 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 79.6%
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:03:29,659 anthropic-direct_LLMRouter the5croz 1998d5ae-3198-4eda-a1dd-45e32064890d -- POST __call__ 200 1.0ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 08-19 18:03:32 [loggers.py:310] Engine 000: Avg prompt throughput: 23.8 tokens/s, Avg generation throughput: 29.8 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 8.7%, Prefix cache hit rate: 82.9%
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:03:33,318 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn 1998d5ae-3198-4eda-a1dd-45e32064890d -- POST /v1/messages 200 3658.2ms
(ServeReplica:anthropic-direct:LLMRouter pid=28239) INFO 2026-08-19 18:03:36,924 anthropic-direct_LLMRouter the5croz 5ab0fc8c-60e9-4328-bf0c-82eadf6c8a81 -- POST __call__ 200 1.0ms
(ServeReplica:anthropic-direct:LLMServer:claude-sonnet-4-5-20250929 pid=28488) INFO 2026-08-19 18:03:38,933 anthropic-direct_LLMServer:claude-sonnet-4-5-20250929 d2ngfytn 5ab0fc8c-60e9-4328-bf0c-82eadf6c8a81 -- POST /v1/messages 200 2008.1ms |
|
Hello @wanadzhar913 and @eicherseiji, thanks for this PR. I stumbled on this PR while looking for Consider an agent like Claude Code that sends several model names to a single base URL and selecting by the model field ( AFAIK direct streaming is single model per app today (limitations https://docs.ray.io/en/latest/serve/llm/user-guides/direct-streaming.html#limitations). So a request naming the second model just gets vLLM's So if "multi-model behind one base URL" isn't on the near-term path for direct streaming then |
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
/unstale |
|
Superceded by #66230, as per direction to move towards Direct Streaming (#66587 (comment)) |


Description
Adds first-class Anthropic Messages API support to Ray Serve LLM for vLLM-based deployments. This allows Anthropic-compatible clients, including Claude Code, to communicate directly with Ray Serve LLM without an additional translation proxy such as LiteLLM or Claude Code Router. The initial implementation supports:
POST /v1/messagesPOST /v1/messages/count_tokensRelated issues
Implementation
LLMEngine,LLMServerProtocol, andLLMServerwithmessagesandcount_tokensoperations.AnthropicServingMessages.AnthropicIngress(which inherits fromOpenaiIngress), reusing the existing ingress model resolution, LoRA routing, handle caching, session affinity, and deployment configuration.build_anthropic_appwith support for both standard ingress and direct streaming.Testing
pytest
API
I tested this using the
anthropic==0.106.0&vllm==0.26.0python library, and have not used Claude Code (yet). Testing infra had the following specs:Ray LLMServer Setup Script
Ray LLMServer Setup Logs
This sets up the
ANTHROPIC_BASE_URLat: http://localhost:8000/v1/messages.Anthropic API Tests Script
Anthropic API Tests Logs
AI assistance
AI assistance was used during implementation. I reviewed the changed code and am responsible for understanding, testing, and maintaining it. Used Cursor: GPT-5.6 Sol, Cursor Grok 4.6