I just made an Open WebUI plugin: SambaNova Function | Open WebUI Community
It leverages this neat trick:
def get_sambanova_models(self):
# 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/193
response = requests.get("https://community.sambanova.ai/t/supported-models/193")
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
It is just like doing [...document.querySelectorAll('code')].map(el => el.textContent)
in the browser console:
Fun that it works, but also kinda frail!
Any chance an official model list endpoint could be added? That would make the SambaNova API one step closer to working with GitHub - open-webui/open-webui: User-friendly AI Interface (Supports Ollama, OpenAI API, ...) out of the box!