[Misc] Move the legacy api_server.py to the examples directory. (#46783)
Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
@@ -178,7 +178,7 @@ incoming requests. The `AsyncLLMEngine` is designed for online serving, where it
|
|||||||
can handle multiple concurrent requests and stream outputs to clients.
|
can handle multiple concurrent requests and stream outputs to clients.
|
||||||
|
|
||||||
The OpenAI-compatible API server uses the `AsyncLLMEngine`. There is also a demo
|
The OpenAI-compatible API server uses the `AsyncLLMEngine`. There is also a demo
|
||||||
API server that serves as a simpler example in [vllm/entrypoints/api_server.py](../../vllm/entrypoints/api_server.py).
|
API server that serves as a simpler example in [examples/applications/api_server/server.py](../../examples/applications/api_server/server.py).
|
||||||
|
|
||||||
The code for `AsyncLLMEngine` can be found in [vllm/engine/async_llm_engine.py](../../vllm/engine/async_llm_engine.py).
|
The code for `AsyncLLMEngine` can be found in [vllm/engine/async_llm_engine.py](../../vllm/engine/async_llm_engine.py).
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ vLLM's examples are organized into the following categories:
|
|||||||
- **[`features/`](../../examples/features)** – Demonstrations of individual vLLM features: automatic prefix caching, speculative decoding, LoRA, structured outputs, prompt embedding, pause/resume, batch invariance, KV events, data parallelism, and more.
|
- **[`features/`](../../examples/features)** – Demonstrations of individual vLLM features: automatic prefix caching, speculative decoding, LoRA, structured outputs, prompt embedding, pause/resume, batch invariance, KV events, data parallelism, and more.
|
||||||
- **[`reasoning/`](../../examples/reasoning)** – Examples for reasoning with vLLM.
|
- **[`reasoning/`](../../examples/reasoning)** – Examples for reasoning with vLLM.
|
||||||
- **[`tool_calling/`](../../examples/tool_calling)** – Examples for function/tool calling with vLLM.
|
- **[`tool_calling/`](../../examples/tool_calling)** – Examples for function/tool calling with vLLM.
|
||||||
- **[`applications/`](../../examples/applications)** – Application examples such as chatbots and RAG (Retrieval-Augmented Generation).
|
- **[`applications/`](../../examples/applications)** – Application examples such as simpler api server, chatbots and RAG (Retrieval-Augmented Generation).
|
||||||
- **[`rl/`](../../examples/rl)** – Reinforcement learning examples.
|
- **[`rl/`](../../examples/rl)** – Reinforcement learning examples.
|
||||||
- **[`deployment/`](../../examples/deployment)** – Examples for deploying vLLM in production.
|
- **[`deployment/`](../../examples/deployment)** – Examples for deploying vLLM in production.
|
||||||
- **[`ray_serving/`](../../examples/ray_serving)** – Scalable serving using Ray.
|
- **[`ray_serving/`](../../examples/ray_serving)** – Scalable serving using Ray.
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
"""Example Python client for `vllm.entrypoints.api_server`
|
"""Example Python client for `examples/applications/api_server/server.py`
|
||||||
Start the demo server:
|
Start the demo server:
|
||||||
python -m vllm.entrypoints.api_server --model <model_name>
|
python examples/applications/api_server/server.py --model <model_name>
|
||||||
|
|
||||||
NOTE: The API server is used only for demonstration and simple performance
|
NOTE: The API server is used only for demonstration and simple performance
|
||||||
benchmarks. It is not intended for production use.
|
benchmarks. It is not intended for production use.
|
||||||
@@ -31,7 +31,7 @@ from vllm.utils.argparse_utils import FlexibleArgumentParser
|
|||||||
from vllm.utils.system_utils import set_ulimit
|
from vllm.utils.system_utils import set_ulimit
|
||||||
from vllm.version import __version__ as VLLM_VERSION
|
from vllm.version import __version__ as VLLM_VERSION
|
||||||
|
|
||||||
logger = init_logger("vllm.entrypoints.api_server")
|
logger = init_logger("api_server")
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
engine = None
|
engine = None
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
"""Example for starting a Gradio Webserver
|
"""Example for starting a Gradio Webserver
|
||||||
Start vLLM API server:
|
Start vLLM API server:
|
||||||
python -m vllm.entrypoints.api_server \
|
python examples/applications/api_server/server.py \
|
||||||
--model meta-llama/Llama-2-7b-chat-hf
|
--model meta-llama/Llama-2-7b-chat-hf
|
||||||
|
|
||||||
Start Webserver:
|
Start Webserver:
|
||||||
|
|||||||
Reference in New Issue
Block a user