Skip to content
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

Use endpoint instead of model in the inference API #2528

Merged
merged 10 commits into from
May 2, 2024
247 changes: 125 additions & 122 deletions output/schema/schema.json

Large diffs are not rendered by default.

9,582 changes: 7,145 additions & 2,437 deletions output/schema/schema/schema.json

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"inference.delete_model": {
"inference.delete": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html",
"description": "Delete model in the Inference API"
"description": "Delete an inference endpoint"
},
"stability": "experimental",
"visibility": "public",
Expand Down Expand Up @@ -31,7 +31,7 @@
},
"inference_id": {
"type": "string",
"description": "The model Id"
"description": "The inference Id"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"inference.get_model": {
"inference.get": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html",
"description": "Get a model in the Inference API"
"description": "Get an inference endpoint"
},
"stability": "experimental",
"visibility": "public",
Expand Down
2 changes: 1 addition & 1 deletion specification/_json_spec/inference.inference.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"inference.inference": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
"description": "Perform inference on a model"
"description": "Perform inference"
},
"stability": "experimental",
"visibility": "public",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"inference.put_model": {
"inference.put": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html",
"description": "Configure a model for use in the Inference API"
"description": "Configure an inference endpoint for use in the Inference API"
},
"stability": "experimental",
"visibility": "public",
Expand Down Expand Up @@ -39,7 +39,7 @@
]
},
"body": {
"description": "The model's task and service settings"
"description": "The endpoint's task and service settings"
davidkyle marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
16 changes: 8 additions & 8 deletions specification/inference/_types/Services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { TaskType } from '../_types/TaskType'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

/**
* Configuration options when storing the model config
* Configuration options when storing the inference endpoint
*/
export class ModelConfig {
export class InferenceEndpoint {
/**
* The service type
*/
Expand All @@ -33,21 +33,21 @@ export class ModelConfig {
*/
service_settings: ServiceSettings
/**
* Task settings specific to the service and model
* Task settings specific to the service and task type
*/
task_settings: TaskSettings
}

/**
* Represents a model as returned by the GET API
* Represents a infenence endpoint as returned by the GET API
pquentin marked this conversation as resolved.
Show resolved Hide resolved
*/
export class ModelConfigContainer extends ModelConfig {
export class InferenceEndpointContainer extends InferenceEndpoint {
/**
* The model Id
* The inference Id
*/
model_id: string
inference_id: string
/**
* The model's task type
* The task type
*/
task_type: TaskType
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { Id } from '@_types/common'
import { TaskType } from '@inference/_types/TaskType'

/**
* Delete an inference service model
* @rest_spec_name inference.delete_model
* Delete an inference endpoint
* @rest_spec_name inference.delete
* @availability stack since=8.11.0 stability=experimental visibility=public
* @availability serverless stability=experimental visibility=public
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { Id } from '@_types/common'
import { TaskType } from '@inference/_types/TaskType'

/**
* Get an inference service model
* @rest_spec_name inference.get_model
* Get an inference endpoint
* @rest_spec_name inference.get
* @availability stack since=8.11.0 stability=experimental visibility=public
* @availability serverless stability=experimental visibility=public
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
* under the License.
*/

import { ModelConfigContainer } from '@inference/_types/Services'
import { InferenceEndpointContainer } from '@inference/_types/Services'

export class Response {
body: {
models: Array<ModelConfigContainer>
/** @aliases models */
Copy link
Member

Choose a reason for hiding this comment

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

Since we decided to break compatibility, should we keep models as an alias? For what it's worth, the current Python client does the wrong thing and would send models as is to the server. That could be fixed in time for 8.15 though.

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 agree and have removed the alias.

The change breaks compatibility, we can do that because the API is neither GA or heavily used therefore it should be a clean break.

endpoints: Array<InferenceEndpointContainer>
}
}
2 changes: 1 addition & 1 deletion specification/inference/inference/InferenceRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface Request extends RequestBase {
*/
query?: string
/**
* Text input to the model.
* Inference input
davidkyle marked this conversation as resolved.
Show resolved Hide resolved
* Either a string or an array of strings.
*/
input: string | Array<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

import { RequestBase } from '@_types/Base'
import { Id } from '@_types/common'
import { ModelConfig } from '@inference/_types/Services'
import { InferenceEndpoint } from '@inference/_types/Services'
import { TaskType } from '@inference/_types/TaskType'

/**
* Create an inference service model
* @rest_spec_name inference.put_model
* Create an inference endpoint
* @rest_spec_name inference.put
* @availability stack since=8.11.0 stability=experimental visibility=public
* @availability serverless stability=experimental visibility=public
*/
Expand All @@ -39,6 +39,6 @@ export interface Request extends RequestBase {
*/
inference_id: Id
}
/** @codegen_name model_config */
body: ModelConfig
/** @codegen_name inference_config */
body: InferenceEndpoint
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

import { ModelConfigContainer } from '@inference/_types/Services'
import { InferenceEndpointContainer } from '@inference/_types/Services'

export class Response {
body: ModelConfigContainer
body: InferenceEndpointContainer
}
Loading