MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / get_llm_status

Function get_llm_status

web/pgadmin/llm/__init__.py:370–401  ·  view source on GitHub ↗

Get the LLM configuration status. Returns whether LLM is enabled at system and user level, and the configured provider and model.

()

Source from the content-addressed store, hash-verified

368@blueprint.route("/status", methods=["GET"], endpoint='status')
369@pga_login_required
370def get_llm_status():
371 """
372 Get the LLM configuration status.
373 Returns whether LLM is enabled at system and user level,
374 and the configured provider and model.
375 """
376 from pgadmin.llm.utils import (
377 is_llm_enabled, is_llm_enabled_system, get_default_provider,
378 get_anthropic_model, get_openai_model, get_ollama_model,
379 get_docker_model
380 )
381
382 provider = get_default_provider()
383 model = None
384 if provider == 'anthropic':
385 model = get_anthropic_model()
386 elif provider == 'openai':
387 model = get_openai_model()
388 elif provider == 'ollama':
389 model = get_ollama_model()
390 elif provider == 'docker':
391 model = get_docker_model()
392
393 return make_json_response(
394 success=1,
395 data={
396 'enabled': is_llm_enabled(),
397 'system_enabled': is_llm_enabled_system(),
398 'provider': provider,
399 'model': model
400 }
401 )
402
403
404@blueprint.route(

Callers

nothing calls this directly

Calls 8

get_default_providerFunction · 0.90
get_anthropic_modelFunction · 0.90
get_openai_modelFunction · 0.90
get_ollama_modelFunction · 0.90
get_docker_modelFunction · 0.90
make_json_responseFunction · 0.90
is_llm_enabledFunction · 0.90
is_llm_enabled_systemFunction · 0.90

Tested by

no test coverage detected