basic backend

This commit is contained in:
Niklas Mueller 2024-06-23 12:57:53 +02:00
parent 16e5004228
commit 89ec0476ca
29 changed files with 2125 additions and 13 deletions

View file

@ -0,0 +1,28 @@
"""Endpoints to retrieve information about the backend configuration."""
import json
from fastapi import APIRouter, Response
from endpoints.llm import LLM
import os
router = APIRouter()
@router.get("/configs", tags=["configurations"])
def get_configs():
"""Get configurations of the backend"""
backend_configs = {
"llm": {
'language': LLM.language,
'max_num_tokens': LLM.max_num_tokens,
'modelname': LLM.modelname
},
'env_vars': {
'language': os.getenv('LLM_LANGUAGE'),
'llm_option': os.getenv('LLM_OPTION'),
'bucket_name': os.getenv('BUCKET_NAME'),
}
}
return Response(status_code=200, content=json.dumps(backend_configs))