Your openai compatible api is missing the /v1/models endpoint for listing the currently available models. Openai’s specification for the endpoint can be found here.
Can this endpoint be made available so that the list of available models can be retrieved and displayed on the end user’s application in real time?
Right now the only way to get all available models is through python (bs4) script.
I’m using this python/python3 script.
import requests
from bs4 import BeautifulSoup
def get_sambanova_models():
# Hey, wanna see something crazy?
# SambaNova offers no model listing API endpoint at the moment.
# However, we can scrape it from the documentation:
# https://community.sambanova.ai/t/supported-models
response = requests.get("https://community.sambanova.ai/t/supported-models")
response.raise_for_status()
soup = BeautifulSoup(response.text, "html.parser")
code_texts = [code.get_text() for code in soup.find_all("code")]
return code_texts
if __name__ == "__main__":
models = get_sambanova_models()
for model in models:
print(model)