mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-15 08:21:16 +03:00
Fallback and try llama-swap format
This commit is contained in:
parent
bae30211d2
commit
78b22d722e
@ -101,15 +101,26 @@ class LlamaCppClient(GenAIClient):
|
|||||||
e,
|
e,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Query /props for context size, modalities, and tool support
|
# Query /props for context size, modalities, and tool support.
|
||||||
|
# The standard /props?model=<name> endpoint works with llama-server.
|
||||||
|
# If it fails, try the llama-swap per-model passthrough endpoint which
|
||||||
|
# returns props for a specific model without requiring it to be loaded.
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
try:
|
||||||
f"{base_url}/props",
|
response = requests.get(
|
||||||
params={"model": configured_model},
|
f"{base_url}/props",
|
||||||
timeout=10,
|
params={"model": configured_model},
|
||||||
)
|
timeout=10,
|
||||||
response.raise_for_status()
|
)
|
||||||
props = response.json()
|
response.raise_for_status()
|
||||||
|
props = response.json()
|
||||||
|
except Exception:
|
||||||
|
response = requests.get(
|
||||||
|
f"{base_url}/upstream/{configured_model}/props",
|
||||||
|
timeout=10,
|
||||||
|
)
|
||||||
|
response.raise_for_status()
|
||||||
|
props = response.json()
|
||||||
|
|
||||||
# Context size from server runtime config
|
# Context size from server runtime config
|
||||||
default_settings = props.get("default_generation_settings", {})
|
default_settings = props.get("default_generation_settings", {})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user