more proxy stats
This commit is contained in:
parent
d8d5514aea
commit
a59dcea2da
|
@ -8,4 +8,7 @@ concurrent_gens: 3
|
|||
|
||||
backend_url: http://172.0.0.2:9104
|
||||
|
||||
# Path that is shown to users for them to connect to
|
||||
frontend_api_client: /api
|
||||
|
||||
database_path: ./proxy-server.db
|
|
@ -12,4 +12,4 @@ def get_running_model():
|
|||
r_json = backend_response.json()
|
||||
return r_json['result']
|
||||
except Exception as e:
|
||||
return False
|
||||
return False
|
|
@ -8,3 +8,4 @@ token_limit = 5555
|
|||
database_path = './proxy-server.db'
|
||||
auth_required = False
|
||||
log_prompts = False
|
||||
frontend_api_client = ''
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import time
|
||||
from datetime import datetime
|
||||
|
||||
from flask import jsonify
|
||||
from flask import jsonify, request
|
||||
|
||||
from llm_server import opts
|
||||
from llm_server.routes.v1.generate import concurrent_semaphore
|
||||
|
@ -31,5 +31,7 @@ def get_stats():
|
|||
'uptime': int((datetime.now() - stats.start_time).total_seconds()),
|
||||
'online': online,
|
||||
'mode': opts.mode,
|
||||
'model': get_running_model(),
|
||||
'client': f'https://{request.headers.get("Host")}/{opts.frontend_api_client.strip("/")}',
|
||||
'timestamp': int(time.time())
|
||||
}), 200
|
||||
|
|
|
@ -22,7 +22,7 @@ if config_path_environ:
|
|||
else:
|
||||
config_path = Path(script_path, 'config', 'config.yml')
|
||||
|
||||
default_vars = {'mode': 'oobabooga', 'log_prompts': False, 'database_path': './proxy-server.db', 'auth_required': False, 'concurrent_gens': 3}
|
||||
default_vars = {'mode': 'oobabooga', 'log_prompts': False, 'database_path': './proxy-server.db', 'auth_required': False, 'concurrent_gens': 3, 'frontend_api_client': ''}
|
||||
required_vars = []
|
||||
config_loader = ConfigLoader(config_path, default_vars, required_vars)
|
||||
success, config, msg = config_loader.load_config()
|
||||
|
@ -45,6 +45,7 @@ opts.mode = config['mode']
|
|||
opts.auth_required = config['auth_required']
|
||||
opts.log_prompts = config['log_prompts']
|
||||
opts.concurrent_gens = config['concurrent_gens']
|
||||
opts.frontend_api_client = config['frontend_api_client']
|
||||
|
||||
app = Flask(__name__)
|
||||
cache.init_app(app)
|
||||
|
|
Reference in New Issue