-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ML] Cache Inference Endpoints #133860
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
[ML] Cache Inference Endpoints #133860
Conversation
Maintain parsed Inference Endpoints in memory for reuse. Endpoints are cached on first access and expire after write. This removes search pressure during inference, bypassing search requests to system indices for repeated model access. When any endpoint is updated or deleted, the whole cache is invalidated and must be reloaded. Cache can be configured with three settings: - `xpack.inference.cache.enabled` enables or disables the cache (default enabled). - `xpack.inference.cache.weight` controls how many endpoints can live in the cache (default 25). - `xpack.inference.cache.expiry_time` controls how long endpoints live in the cache, measured from when they are first accessed (default 15 minutes, minimum 1 minute, maximum 1 hour). Resolve elastic#133135
|
Hi @prwhelan, I've created a changelog YAML for you. |
|
Pinging @elastic/ml-core (Team:ML) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good just left a few questions
.../main/java/org/elasticsearch/xpack/inference/registry/ClearInferenceEndpointCacheAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/SerializableStats.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferencePlugin.java
Outdated
Show resolved
Hide resolved
...ence/src/main/java/org/elasticsearch/xpack/inference/registry/InferenceEndpointRegistry.java
Outdated
Show resolved
Hide resolved
...src/test/java/org/elasticsearch/xpack/inference/registry/InferenceEndpointRegistryTests.java
Outdated
Show resolved
Hide resolved
.../main/java/org/elasticsearch/xpack/inference/registry/ClearInferenceEndpointCacheAction.java
Outdated
Show resolved
Hide resolved
.../main/java/org/elasticsearch/xpack/inference/registry/ClearInferenceEndpointCacheAction.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Project Aware!!!! nice. Looks good I'll take another pass at it later
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/SerializableStats.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferencePlugin.java
Outdated
Show resolved
Hide resolved
...ence/src/main/java/org/elasticsearch/xpack/inference/registry/InferenceEndpointRegistry.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is a really good change one I've wanted to make for a while
Maintain parsed Inference Endpoints in memory for reuse. Endpoints are cached on first access and expire after write. This removes search pressure during inference, bypassing search requests to system indices for repeated model access. When any endpoint is updated or deleted, the whole cache is invalidated and must be reloaded.
Cache can be configured with three settings:
xpack.inference.cache.enabledenables or disables the cache (default enabled).xpack.inference.cache.weightcontrols how many endpoints can live in the cache (default 25).xpack.inference.cache.expiry_timecontrols how long endpoints live in the cache, measured from when they are first accessed (default 15 minutes, minimum 1 minute, maximum 1 hour).Resolve #133135