generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 89
Add Endpoint Picker Protocol Proposal #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Model Server Protocol for Gateway API Inference Extension | ||
|
||
## Inference API Protocol | ||
|
||
The model server MUST implement OpenAI’s [Completions](https://platform.openai.com/docs/api-reference/completions) | ||
and [Chat](https://platform.openai.com/docs/api-reference/chat) API. In the future we are open to | ||
supporting more API protocols. | ||
liu-cong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<details> | ||
<summary>Why?</summary> | ||
The extension makes intelligent request scheduling decisions based on certain information from the | ||
request body, such as the `model` field. | ||
</details> | ||
|
||
## Metrics Reporting | ||
|
||
The inference extension scrapes metrics from the model servers to make optimal request scheduling | ||
decisions. The model servers MUST provide the following metrics via a Prometheus endpoint. While | ||
the metric names may differ slightly in different model servers, the metric types MUST be the same. | ||
We will align with the | ||
[model server metrics standardization](https://docs.google.com/document/d/1SpSp1E6moa4HSrJnS4x3NpLuj88sMXr2tbofKlzTZpk) | ||
effort. | ||
ahg-g marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
We also show the metrics in vLLM, which is already integrated into the inference extension. We will | ||
liu-cong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
add more model servers once they are integrated. | ||
|
||
| Metric | Type | Description | vLLM metric | | ||
| ----- | ---- | ---- | ---- | | ||
| TotalQueuedRequests | Gauge | The current total number of requests in the queue.| `vllm:num_requests_waiting`| | ||
| KVCacheUtilization| Gauge | The current KV cache utilization in percentage.| `vllm:gpu_cache_usage_perc`| | ||
|
||
## [Experimental] LoRA Adapter Serving | ||
liu-cong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Model servers that support dynamic LoRA serving can gain additional benefit from the inference | ||
extension's LoRA affinity algorithm. As dynamic LoRA serving is quite new and evolving, this part is considered experimental and subject to changes in future releases. | ||
liu-cong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The inference extension expects the following behavior from compatible model servers. | ||
|
||
* Support running multiple LoRA adapters in parallel in the same decode batch. | ||
* Dynamically load/unload adapters in GPU memory from/to a cache (e.g., in host memory) depending on | ||
ahg-g marked this conversation as resolved.
Show resolved
Hide resolved
|
||
the requested adapters in the current batch. | ||
|
||
The model server MUST expose the following LoRA adapter information via a RESTful API with response in JSON : | ||
liu-cong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* `Config` | ||
* `LoRAEnabled`: boolean, whether dynamic LoRA serving is enabled. | ||
* `MaxActiveAdapter`: integer, the maximum number of adapters that can be loaded to GPU memory to serve a batch. | ||
Requests will be queued if the model server has reached MaxActiveAdapter and cannot load the | ||
requested adapter. | ||
* `State` | ||
* `ActiveAdapters`: List[string], a list of adapters that are currently loaded in GPU memory and ready to serve | ||
requests. | ||
|
||
This is an example API endpoint and response: | ||
``` | ||
GET ${server_endpoint}/adapters/info | ||
``` | ||
|
||
``` | ||
{ | ||
"config": { | ||
"enabled": true, | ||
"maxActiveAdapters": 4, | ||
}, | ||
"state": { | ||
"activeAdapters": ["adapter1", "adapter2"] | ||
} | ||
} | ||
``` | ||
|
||
NOTE: Currently in vLLM v0.6.6, LoRA info is exposed in the `vllm:lora_requests_info` metric, where | ||
`MaxActiveAdapters` is exposed as a string label `max_lora`, and `ActiveAdapters` as a comma separated string label `running_lora_adapters`. | ||
liu-cong marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.