Skip to content

Commit 39f7575

Browse files
committed
refac: show connection type for custom models
1 parent 954aaa6 commit 39f7575

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/open_webui/utils/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
191191
):
192192
# Custom model based on a base model
193193
owned_by = "openai"
194+
connection_type = None
195+
194196
pipe = None
195197

196198
for m in models:
@@ -201,6 +203,8 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
201203
owned_by = m.get("owned_by", "unknown")
202204
if "pipe" in m:
203205
pipe = m["pipe"]
206+
207+
connection_type = m.get("connection_type", None)
204208
break
205209

206210
model = {
@@ -209,6 +213,7 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
209213
"object": "model",
210214
"created": custom_model.created_at,
211215
"owned_by": owned_by,
216+
"connection_type": connection_type,
212217
"preset": True,
213218
**({"pipe": pipe} if pipe is not None else {}),
214219
}

0 commit comments

Comments
 (0)