Skip to content

[ML] Integrate with DeepSeek API #122218

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 17 commits into from
Mar 12, 2025
Merged

[ML] Integrate with DeepSeek API #122218

merged 17 commits into from
Mar 12, 2025

Conversation

prwhelan
Copy link
Member

@prwhelan prwhelan commented Feb 10, 2025

Integrating for Chat Completion and Completion task types, both calling the chat completion API for DeepSeek.


Verified:

  • content string
  • content object with "type": "text" + "text": "what is elastic"
  • max_completion_tokens does not work, we need to map to max_tokens
  • role field works
  • tools work
  • sending n is benign
  • temperature works
  • tool_choice works
  • strict tools is benign
  • top_p works
  • stream works
  • Added tests verifying unified error response

Integrating for Chat Completion and Completion task types, both calling
the chat completion API for DeepSeek.
@prwhelan prwhelan added >enhancement :ml Machine learning Team:ML Meta label for the ML team v9.1.0 labels Feb 10, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @prwhelan, I've created a changelog YAML for you.

@prwhelan prwhelan added auto-backport Automatically create backport pull requests when merged v8.19.0 labels Feb 25, 2025
@prwhelan prwhelan marked this pull request as ready for review February 25, 2025 22:51
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

var validationException = new ValidationException();

var model = extractRequiredString(serviceSettingsMap, MODEL_ID, ModelConfigurations.SERVICE_SETTINGS, validationException);
var uri = createOptionalUri(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to allow users to set the URL in the create inference endpoint request? If this is only for testing, then I think we can allow the child classes to override a method to return it, or pass it in via the constructor. Then in the tests we can set it via a constructor or a setter or something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really only left it exposed but optional because anyone can in theory run the model locally behind an OpenAI compatible endpoint and then call it that way.

I can remove it though if that's not something we want to support, I'm neutral towards it

@prwhelan prwhelan removed the auto-backport Automatically create backport pull requests when merged label Mar 11, 2025
@prwhelan prwhelan enabled auto-merge (squash) March 12, 2025 13:19
@prwhelan prwhelan merged commit 9f89a3b into elastic:main Mar 12, 2025
17 checks passed
albertzaharovits pushed a commit to albertzaharovits/elasticsearch that referenced this pull request Mar 13, 2025
Integrating for Chat Completion and Completion task types, both calling
the chat completion API for DeepSeek.
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Mar 13, 2025
Integrating for Chat Completion and Completion task types, both calling
the chat completion API for DeepSeek.
prwhelan added a commit to prwhelan/elasticsearch that referenced this pull request Mar 13, 2025
Integrating for Chat Completion and Completion task types, both calling
the chat completion API for DeepSeek.
prwhelan added a commit that referenced this pull request Mar 13, 2025
Integrating for Chat Completion and Completion task types, both calling
the chat completion API for DeepSeek.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :ml Machine learning Team:ML Meta label for the ML team v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants