INNER CODE UNIT · Python
list_models
hyperonym/basaran · basaran/__main__.py:116
def list_models():
"""List the currently available models."""
info = {"id": SERVER_MODEL_NAME, "object": "model"}
return jsonify(data=[info], object="list")
@app.route("/v1/models/<path:name>")
def retrieve_model(name):
"""Retrieve basic information about the model."""
if name != SERVER_MODEL_NAME:
abort(404, description="model does not exist")
return jsonify(id=SERVER_MODEL_NAME, object="model")
@app.route("/v1/completions", methods=["GET", "POST"])
def create_completion():
"""Create a completion for the provided prompt and parameters."""
schema = {