UntilDot commited on
Commit
f8b631f
·
verified ·
1 Parent(s): 579efff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -17,6 +17,17 @@ def index():
17
  def docs():
18
  return render_template("docs.html")
19
 
 
 
 
 
 
 
 
 
 
 
 
20
  @app.route("/chat", methods=["POST"])
21
  def chat():
22
  data = request.get_json()
 
17
  def docs():
18
  return render_template("docs.html")
19
 
20
+ # === New models endpoint ===
21
+ @app.route("/models", methods=["GET"])
22
+ def get_models():
23
+ try:
24
+ with open("llm/model_config.json", "r") as f:
25
+ config = json.load(f)
26
+ models = [{"id": model_id, "name": model_id.split(":")[0].split("/")[-1].replace("-", " ").title()} for model_id in config["models"].keys()]
27
+ return jsonify(models)
28
+ except Exception as e:
29
+ return jsonify({"error": str(e)}), 500
30
+
31
  @app.route("/chat", methods=["POST"])
32
  def chat():
33
  data = request.get_json()