Skip to content

Commit

Permalink
skip caching typescript only, fix error message, format code
Browse files Browse the repository at this point in the history
  • Loading branch information
vanpelt committed Sep 20, 2024
1 parent 427b3fd commit b8a05d3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions backend/openui/litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import tempfile
import openai
from .logs import logger


def generate_config():
Expand Down Expand Up @@ -104,17 +105,20 @@ def generate_config():
try:
for model in client.models.list().data:
models.append(
{
"model_name": model.id,
"litellm_params": {
"model": f"openai/{model.id}",
"api_key": os.getenv("OPENAI_COMPATIBLE_API_KEY"),
"base_url": os.getenv("OPENAI_COMPATIBLE_ENDPOINT"),
},
{
"model_name": model.id,
"litellm_params": {
"model": f"openai/{model.id}",
"api_key": os.getenv("OPENAI_COMPATIBLE_API_KEY"),
"base_url": os.getenv("OPENAI_COMPATIBLE_ENDPOINT"),
},
}
)
except Exception as e:
print(f"Error listing models for {os.getenv('OPENAI_COMPATIBLE_ENDPOINT')}: {e}")
logger.exception(
f"Error listing models for {os.getenv('OPENAI_COMPATIBLE_ENDPOINT')}: %s",
e,
)

yaml_structure = {"model_list": models}
with tempfile.NamedTemporaryFile(
Expand Down
2 changes: 1 addition & 1 deletion backend/openui/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ async def get_groq_models():
d for d in (await groq.models.list()).data if not d.id.startswith("whisper")
]
except Exception:
logger.warning("Couldn't connect to Ollama at %s", config.GROQ_BASE_URL)
logger.warning("Couldn't connect to Groq at %s", config.GROQ_BASE_URL)
return []


Expand Down
2 changes: 1 addition & 1 deletion frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineConfig(({ mode }) => ({
registerType: 'autoUpdate',
workbox: {
maximumFileSizeToCacheInBytes: 4000000,
globIgnores: ['**/annotator/**', '**/monacoeditorwork/**'],
globIgnores: ['**/annotator/**', '**/ts.worker.bundle.js'],
navigateFallbackDenylist: [/\/openui\/.*/, /\/v1\/.*/]
},
manifest: {
Expand Down

0 comments on commit b8a05d3

Please sign in to comment.