-
Notifications
You must be signed in to change notification settings - Fork 115
[ML] Add DeepSeek #4723
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
[ML] Add DeepSeek #4723
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5d18558
[ML] Add DeepSeek
prwhelan 2a51c3a
Update specification/inference/_types/CommonTypes.ts
prwhelan 4670a20
Remove example alternatives; remove duplicate task type enum
prwhelan 9661a88
Merge remote-tracking branch 'origin/main' into deepseek
pquentin 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
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
72 changes: 72 additions & 0 deletions
72
specification/inference/put_deepseek/PutDeepSeekRequest.ts
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 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { RequestBase } from '@_types/Base' | ||
| import { Id } from '@_types/common' | ||
| import { | ||
| DeepSeekServiceSettings, | ||
| DeepSeekServiceType, | ||
| DeepSeekTaskType | ||
| } from '@inference/_types/CommonTypes' | ||
| import { InferenceChunkingSettings } from '@inference/_types/Services' | ||
|
|
||
| /** | ||
| * Create a DeepSeek inference endpoint. | ||
| * | ||
| * Create an inference endpoint to perform an inference task with the `deepseek` service. | ||
| * @rest_spec_name inference.put_deepseek | ||
| * @availability stack since=9.1.0 stability=stable visibility=public | ||
| * @availability serverless stability=stable visibility=public | ||
| * @cluster_privileges manage_inference | ||
| * @doc_id inference-api-put-deepseek | ||
| */ | ||
| export interface Request extends RequestBase { | ||
| urls: [ | ||
| { | ||
| path: '/_inference/{task_type}/{deepseek_inference_id}' | ||
| methods: ['PUT'] | ||
| } | ||
| ] | ||
| path_parts: { | ||
| /** | ||
| * The type of the inference task that the model will perform. | ||
| */ | ||
| task_type: DeepSeekTaskType | ||
pquentin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /** | ||
| * The unique identifier of the inference endpoint. | ||
| */ | ||
| deepseek_inference_id: Id | ||
| } | ||
| body: { | ||
| /** | ||
| * The chunking configuration object. | ||
| * @ext_doc_id inference-chunking | ||
| */ | ||
| chunking_settings?: InferenceChunkingSettings | ||
| /** | ||
| * The type of service supported for the specified task type. In this case, `deepseek`. | ||
| */ | ||
| service: DeepSeekServiceType | ||
| /** | ||
| * Settings used to install the inference model. | ||
| * These settings are specific to the `deepseek` service. | ||
| */ | ||
| service_settings: DeepSeekServiceSettings | ||
| } | ||
| } | ||
25 changes: 25 additions & 0 deletions
25
specification/inference/put_deepseek/PutDeepSeekResponse.ts
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,25 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { InferenceEndpointInfoDeepSeek } from '@inference/_types/Services' | ||
|
|
||
| export class Response { | ||
| /** @codegen_name endpoint_info */ | ||
| body: InferenceEndpointInfoDeepSeek | ||
| } |
80 changes: 80 additions & 0 deletions
80
specification/inference/put_deepseek/request/PutDeepSeekRequestExample1.yaml
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,80 @@ | ||
| summary: A completion task | ||
| description: Run `PUT _inference/completion/deepseek-completion` to create an inference endpoint that performs a completion task. | ||
| method_request: 'PUT _inference/completion/deepseek-completion' | ||
| # type: "request" | ||
| value: |- | ||
| { | ||
| "service": "deepseek", | ||
| "service_settings": { | ||
| "api_key": "DeepSeek-Api-key", | ||
| "model_id": "deepseek-chat" | ||
| } | ||
| } | ||
| alternatives: | ||
| - language: Python | ||
| code: |- | ||
| resp = client.inference.put( | ||
| task_type="completion", | ||
| inference_id="deepseek-completion", | ||
| inference_config={ | ||
| "service": "deepseek", | ||
| "service_settings": { | ||
| "api_key": "DeepSeek-Api-key", | ||
| "model_id": "deepseek-chat" | ||
| } | ||
| }, | ||
| ) | ||
| - language: JavaScript | ||
| code: |- | ||
| const response = await client.inference.put({ | ||
| task_type: "completion", | ||
| inference_id: "deepseek-completion", | ||
| inference_config: { | ||
| service: "deepseek", | ||
| service_settings: { | ||
| api_key: "DeepSeek-Api-key", | ||
| model_id: "deepseek-chat" | ||
| }, | ||
| }, | ||
| }); | ||
| - language: Ruby | ||
| code: |- | ||
| response = client.inference.put( | ||
| task_type: "completion", | ||
| inference_id: "deepseek-completion", | ||
| body: { | ||
| "service": "deepseek", | ||
| "service_settings": { | ||
| "api_key": "DeepSeek-Api-key", | ||
| "model_id": "deepseek-chat" | ||
| } | ||
| } | ||
| ) | ||
| - language: PHP | ||
| code: |- | ||
| $resp = $client->inference()->put([ | ||
| "task_type" => "completion", | ||
| "inference_id" => "deepseek-completion", | ||
| "body" => [ | ||
| "service" => "deepseek", | ||
| "service_settings" => [ | ||
| "api_key" => "DeepSeek-Api-key", | ||
| "model_id" => "deepseek-chat" | ||
| ], | ||
| ], | ||
| ]); | ||
| - language: curl | ||
| code: | ||
| 'curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d | ||
| ''{"service":"deepseek","service_settings":{"api_key":"DeepSeek-Api-key","model_id":"deepseek-chat" | ||
| }'' "$ELASTICSEARCH_URL/_inference/completion/deepseek-completion"' | ||
| - language: Java | ||
| code: > | ||
| client.inference().put(p -> p | ||
| .inferenceId("deepseek-completion") | ||
| .taskType(TaskType.Completion) | ||
| .inferenceConfig(i -> i | ||
| .service("deepseek") | ||
| .serviceSettings(JsonData.fromJson("{\"api_key\":\"DeepSeek-Api-key\",\"model_id\":\"deepseek-chat\"}")) | ||
| ) | ||
| ); | ||
pquentin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Oops, something went wrong.
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.