diff --git a/x-pack/plugins/search_inference_endpoints/public/index.ts b/x-pack/plugins/search_inference_endpoints/public/index.ts index b06f1f64b909d..1c9e267a18bde 100644 --- a/x-pack/plugins/search_inference_endpoints/public/index.ts +++ b/x-pack/plugins/search_inference_endpoints/public/index.ts @@ -17,3 +17,5 @@ export type { SearchInferenceEndpointsPluginSetup, SearchInferenceEndpointsPluginStart, } from './types'; + +export const INFERENCE_ENDPOINTS_UI_FLAG = 'inferenceEndpointsUi:enabled'; diff --git a/x-pack/plugins/search_inference_endpoints/public/plugin.ts b/x-pack/plugins/search_inference_endpoints/public/plugin.ts index ab49281f82e4c..a864b7c0fcdd6 100644 --- a/x-pack/plugins/search_inference_endpoints/public/plugin.ts +++ b/x-pack/plugins/search_inference_endpoints/public/plugin.ts @@ -21,6 +21,7 @@ import { SearchInferenceEndpointsPluginSetup, SearchInferenceEndpointsPluginStart, } from './types'; +import { INFERENCE_ENDPOINTS_UI_FLAG } from '.'; export class SearchInferenceEndpointsPlugin implements Plugin @@ -34,8 +35,11 @@ export class SearchInferenceEndpointsPlugin public setup( core: CoreSetup ): SearchInferenceEndpointsPluginSetup { - if (!this.config.ui?.enabled) return {}; - + if ( + !this.config.ui?.enabled && + !core.uiSettings.get(INFERENCE_ENDPOINTS_UI_FLAG, false) + ) + return {}; core.application.register({ id: PLUGIN_ID, appRoute: '/app/search_inference_endpoints',