Skip to content

[ML] Add Groq inference service#138251

Merged
davidkyle merged 13 commits intoelastic:mainfrom
bamchip:bamchip/groq-elastic-integration
Dec 2, 2025
Merged

[ML] Add Groq inference service#138251
davidkyle merged 13 commits intoelastic:mainfrom
bamchip:bamchip/groq-elastic-integration

Conversation

@bamchip
Copy link
Contributor

@bamchip bamchip commented Nov 18, 2025

Summary

  • Add Groq as a chat completion inference provider, wiring up service registration, action creators, settings validation, and REST surface.
  • Extend tests and docs to cover the Groq-specific behaviors and configuration knobs.

Testing

Create Groq chat completion endpoint

{
  "service": "groq",
  "service_settings": {
    "model_id": "llama-3.3-70b-versatile",
    "api_key": "<GROQ_API_KEY>"
  }
}

Stream chat completion

{
  "messages": [
    { "role": "user", "content": "Explain Groq in one sentence." }
  ]
}

Stream chat completion with tool calling

{
  "messages": [
    {
      "role": "user",
      "content": [
        { "type": "text", "text": "What is the current price of item 123?" }
      ]
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_current_price",
        "description": "Look up the latest price for a catalog item.",
        "parameters": {
          "type": "object",
          "properties": {
            "item": { "type": "string", "description": "Catalog identifier (e.g. SKU)" },
            "currency": {
              "type": "string",
              "description": "ISO currency code",
              "enum": ["USD", "EUR", "GBP"]
            }
          },
          "required": ["item"]
        }
      }
    }
  ],
  "tool_choice": {
    "type": "function",
    "function": { "name": "get_current_price" }
  }
}
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.3.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Nov 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

🔍 Preview links for changed docs

@github-actions
Copy link
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@bamchip bamchip force-pushed the bamchip/groq-elastic-integration branch from ed7dc20 to 1d8c585 Compare November 18, 2025 17:50
@bamchip bamchip force-pushed the bamchip/groq-elastic-integration branch from 1d8c585 to 27e55c0 Compare November 19, 2025 18:47
@davidkyle davidkyle self-assigned this Nov 20, 2025
@davidkyle davidkyle added >enhancement :ml Machine learning and removed needs:triage Requires assignment of a team area label labels Nov 20, 2025
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Nov 20, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@davidkyle
Copy link
Member

@elasticmachine test this please

@davidkyle
Copy link
Member

@elasticmachine test this please

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

Looks great I left a couple of minor comments.

CI failed due to the use of a forbidden reflection API call in a test I pushed a change to remove that. You can run the precommit target locally to check for these sorts of problems with

./gradlew :x-pack:plugin:inference:spotlessApply :x-pack:plugin:inference:precommit

To run the tests its

./gradlew :x-pack:plugin:inference:test
@davidkyle
Copy link
Member

Related Kibana issue for the icon elastic/kibana#243696

bamchip and others added 2 commits November 20, 2025 10:24
Co-authored-by: David Kyle <david.kyle@elastic.co>
…e and task setting tests to support new AbstractWireSerializingTestCase base class.
@bamchip bamchip requested a review from davidkyle November 20, 2025 19:14
@bamchip
Copy link
Contributor Author

bamchip commented Nov 20, 2025

@elasticmachine test this please

@bamchip
Copy link
Contributor Author

bamchip commented Nov 20, 2025

@davidkyle I see a conflict in server/src/main/resources/transport/upper_bounds/9.3.csv but not sure if I should overwrite it. Will let you guide me there :)

@davidkyle
Copy link
Member

@elasticmachine test this please

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@davidkyle
Copy link
Member

I see a conflict in server/src/main/resources/transport/upper_bounds/9.3.csv

I resolved it by accepting the incoming change then ran ./gradlew generateTransportVersion again. However, since this morning it has happened again and it will keep on happening.

The PR is approved, I'll merge it once the UI change elastic/kibana#243696 is underway so that the icon is not missing when groq appears in Elastic serverless.

@davidkyle davidkyle enabled auto-merge (squash) December 1, 2025 10:21
@davidkyle
Copy link
Member

@elasticmachine test this please

@davidkyle
Copy link
Member

@elasticmachine run elasticsearch-ci/bwc-snapshots-part3

@davidkyle
Copy link
Member

@elasticmachine test this please

@davidkyle
Copy link
Member

@elasticmachine test this please

@davidkyle davidkyle merged commit c9e1f92 into elastic:main Dec 2, 2025
35 checks passed
alvarezmelissa87 added a commit to elastic/kibana that referenced this pull request Dec 3, 2025
…: add groq icon (#244962)

## Summary

Fixes #243696

Groq will be added to the Inference API in
elastic/elasticsearch#138251 with the service
name `groq`.
This PR adds the `groq` icon to the providers list shown in the AI
Connector and inference endpoint creation providers list and updates
telemetry.

<img width="893" height="577" alt="image"
src="https://github.com/user-attachments/assets/7e03144f-9f32-42d9-b423-7f79d48020a3"
/>

<img width="894" height="416" alt="image"
src="https://github.com/user-attachments/assets/fc4d4ed4-8ea4-4f4b-8440-a0a7e9c1cb8b"
/>



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
JordanSh pushed a commit to JordanSh/kibana that referenced this pull request Dec 9, 2025
…: add groq icon (elastic#244962)

## Summary

Fixes elastic#243696

Groq will be added to the Inference API in
elastic/elasticsearch#138251 with the service
name `groq`.
This PR adds the `groq` icon to the providers list shown in the AI
Connector and inference endpoint creation providers list and updates
telemetry.

<img width="893" height="577" alt="image"
src="https://github.com/user-attachments/assets/7e03144f-9f32-42d9-b423-7f79d48020a3"
/>

<img width="894" height="416" alt="image"
src="https://github.com/user-attachments/assets/fc4d4ed4-8ea4-4f4b-8440-a0a7e9c1cb8b"
/>



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement external-contributor Pull request authored by a developer outside the Elasticsearch team :ml Machine learning Team:ML Meta label for the ML team v9.3.0

3 participants