Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export interface GetModelDownloadConfigOptions {
}

export interface LocalInferenceServiceSettings {
service: 'elser' | 'elasticsearch';
service: 'elasticsearch';
service_settings: {
num_allocations: number;
num_threads: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const getCustomInferenceIdMap = (
const inferenceEntry = isLocalModel(model)
? {
trainedModelId: model.service_settings.model_id,
isDeployable: model.service === Service.elser || model.service === Service.elasticsearch,
isDeployable: model.service === Service.elasticsearch,
isDeployed: modelStatsById[model.inference_id]?.state === 'started',
isDownloading: Boolean(downloadStates[model.service_settings.model_id]),
modelStats: modelStatsById[model.inference_id],
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
import type { IKibanaResponse, IRouter, RequestHandlerContext } from '@kbn/core/server';
import { Logger } from '@kbn/logging';
import { schema } from '@kbn/config-schema';
import { InferenceInferenceEndpointInfo } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import {
InferenceInferenceEndpointInfo,
InferenceTaskType,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';

import { InferenceServicesGetResponse } from '../types';
import { INFERENCE_ENDPOINT_INTERNAL_API_VERSION } from '../../common';
import { addInferenceEndpoint } from '../lib/add_inference_endpoint';
import { inferenceEndpointExists } from '../lib/inference_endpoint_exists';
import { unflattenObject } from '../utils/unflatten_object';

const inferenceEndpointSchema = schema.object({
config: schema.object({
Expand Down Expand Up @@ -90,7 +93,20 @@ export const getInferenceServicesRoute = (
const esClient = (await context.core).elasticsearch.client.asCurrentUser;

const { config, secrets } = request.body;
const result = await addInferenceEndpoint(esClient, config, secrets);

const serviceSettings = {
...unflattenObject(config?.providerConfig ?? {}),
...unflattenObject(secrets?.providerSecrets ?? {}),
};

const result = await esClient.inference.put({
inference_id: config?.inferenceId ?? '',
task_type: config?.taskType as InferenceTaskType,
inference_config: {
service: config?.provider,
service_settings: serviceSettings,
},
});

return response.ok({
body: result,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading