Commit beb18a8
Add Llama support to Inference Plugin (elastic#130092)
* Refactor Hugging Face service settings and completion request methods for consistency
* Add Llama model support for embeddings and chat completions
* Refactor Llama request classes to improve secret settings handling
* Refactor DeltaParser in LlamaStreamingProcessor to improve argument handling
* Enhance Llama streaming processing by adding support for nullable object arrays
* [CI] Auto commit changes from spotless
* Fix error messages in LlamaActionCreator
* [CI] Auto commit changes from spotless
* Add detailed Javadoc comments to Llama classes for improved documentation
* Enhance LlamaChatCompletionResponseHandler to support mid-stream error handling and improve error response parsing
* Add Javadoc comments to Llama classes for improved documentation and clarity
* Fix checkstyle
* Update LlamaEmbeddingsRequest to use mediaTypeWithoutParameters for content type header
* Add unit tests for LlamaActionCreator and related models
* Add unit tests for LlamaChatCompletionServiceSettings to validate configuration parsing and serialization
* Add unit tests for LlamaEmbeddingsServiceSettings to validate configuration parsing and serialization
* Add unit tests for LlamaEmbeddingsServiceSettings to validate various configuration scenarios
* Add unit tests for LlamaChatCompletionResponseHandler to validate error response handling
* Refactor Llama embedding and chat completion tests for consistency and clarity
* Add unit tests for LlamaChatCompletionRequestEntity to validate message serialization
* Add unit tests for LlamaEmbeddingsRequest to validate request creation and truncation behavior
* Add unit tests for LlamaEmbeddingsRequestEntity to validate XContent serialization
* Add unit tests for LlamaErrorResponse to validate error handling from HTTP responses
* Add unit tests for LlamaChatCompletionServiceSettings to validate configuration parsing and serialization
* Add tests for LlamaService request configuration validation and error handling
* Fix error message formatting in LlamaServiceTests for better localization support
* Refactor Llama model classes to implement accept method for action visitors
* Hide Llama service from configuration API to enhance security and reduce exposure
* Refactor Llama model classes to remove modelId and update embedding request handling
* Refactor Llama request classes to use pattern matching for secret settings
* Update embeddings handler to use HuggingFace response entity
* Refactor Mistral model classes to remove modelId and update rate limit hashing
* Refactor Mistral action classes to remove taskSettings parameter and streamline action creation
* Refactor Llama and Mistral models to remove taskSettings parameter and simplify model instantiation
* Refactor Llama service tests to use Model instead of CustomModel and update similarity measure to DOT_PRODUCT
* Remove unused tests and imports from LlamaServiceTests
* Add chunking settings support to Llama embeddings model tests
* Add changelog
* Add support for version checks in Llama settings and define new transport version
* Refactor Llama model assertions and remove unused version support methods
* Refactor Llama service constructors to include ClusterService and improve error message handling
---------
Co-authored-by: elasticsearchmachine <[email protected]>1 parent f664cf5 commit beb18a8
File tree
54 files changed
+4517
-92
lines changed- docs/changelog
- libs/x-content/src/main/java/org/elasticsearch/xcontent
- server/src/main/java/org/elasticsearch
- inference
- x-pack/plugin
- core/src/test/java/org/elasticsearch/xpack/core/inference/action
- inference/src
- main/java/org/elasticsearch/xpack/inference
- services
- elastic/request
- huggingface
- completion
- elser
- rerank
- llama
- action
- completion
- embeddings
- request
- completion
- embeddings
- response
- mistral
- action
- completion
- embeddings
- request/embeddings
- openai
- request
- test/java/org/elasticsearch/xpack/inference/services
- llama
- action
- completion
- embeddings
- request
- completion
- embeddings
- response
- mistral
- embeddings
- request/completion
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
54 files changed
+4517
-92
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
223 | 244 | | |
224 | 245 | | |
225 | 246 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
346 | 347 | | |
347 | 348 | | |
348 | 349 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| 180 | + | |
178 | 181 | | |
179 | 182 | | |
180 | 183 | | |
| |||
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
| 280 | + | |
| 281 | + | |
277 | 282 | | |
278 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
279 | 299 | | |
280 | 300 | | |
281 | 301 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| |||
402 | 403 | | |
403 | 404 | | |
404 | 405 | | |
| 406 | + | |
405 | 407 | | |
406 | 408 | | |
407 | 409 | | |
| |||
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
304 | 305 | | |
305 | 306 | | |
306 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
307 | 314 | | |
308 | 315 | | |
309 | 316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
Lines changed: 1 addition & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | 36 | | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 72 | | |
80 | 73 | | |
81 | 74 | | |
| |||
0 commit comments