Skip to content

Update inference API specification to include new Llama Service #5020

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Jan-Kazlouski-elastic
Copy link
Contributor

This PR adds changes to specification caused by elastic/elasticsearch#130092:

Additional actions

  • Signed the CLA
  • Executed make contrib

*
* Create an inference endpoint to perform an inference task with the `llama` service.
* @rest_spec_name inference.put_llama
* @availability stack since=9.2.0 stability=stable visibility=public
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonathan-buttner could you please check if this 9.2.0 version is correctly set here. I assume it is, but want to be sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep this is correct 👍

…ng-completion

# Conflicts:
#	output/openapi/elasticsearch-openapi.json
#	output/openapi/elasticsearch-serverless-openapi.json
#	output/schema/schema.json
Copy link
Contributor

Following you can find the validation changes against the target branch for the APIs.

No changes detected.

You can validate these APIs yourself by using the make validate target.

@Jan-Kazlouski-elastic Jan-Kazlouski-elastic added the skip-backport This pull request should not be backported label Jul 22, 2025
@Jan-Kazlouski-elastic
Copy link
Contributor Author

@jonathan-buttner since we didn't have backport for Llama integration, I added skip-backport label in order to skip backport label github action check

Copy link
Contributor

@jonathan-buttner jonathan-buttner left a comment

Choose a reason for hiding this comment

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

Looking good, left a few questions

* After creating the inference model, you cannot change the associated API key.
* If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.
*/
api_key?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

I should have mentioned this on the elasticsearch PR. When did you need to supply an API key? In my testing of running the stack locally I didn't need to supply one 🤔

I was running it like this:

PUT _inference/text_embedding/llama-text-embedding
{
    "service": "llama",
    "service_settings": {
        "url": "http://localhost:8321/v1/inference/embeddings",
        "model_id": "all-MiniLM-L6-v2"
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is good point to discuss. Glad you're bringing that up.
Llama Stack doesn't have built in authorization check by default, so It is possible to use it without providing any tokens. Specially when testing with Ollama locally.
However for me it is doubtful that users are going to use llama stack without auth 100% of the time so I added this api_key parameter as option for clients that would want to set up bearer auth. Authentication Configuration is described in Distribution Overview's Server Configuration section of official Llama Stack guide.
https://llama-stack.readthedocs.io/en/latest/distributions/configuration.html#authentication-configuration
I haven't investigated it in depth but I think it is safe to assume that providing ability to send bearer token pretty much covers security concerns.

*
* Create an inference endpoint to perform an inference task with the `llama` service.
* @rest_spec_name inference.put_llama
* @availability stack since=9.2.0 stability=stable visibility=public
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep this is correct 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ml skip-backport This pull request should not be backported specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants