Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/llama_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"n_gpu_layers", "main_gpu", "split_mode", "tensor_split",
"no_kv_offload", "no_op_offload", "flash_attn_type",
# Memory
"use_mmap", "use_mlock",
"cache_type_k", "cache_type_v",
"cache_prompt", "cache_idle_slots", "cache_ram_mib",
# RoPE / YaRN
Expand All @@ -32,7 +31,7 @@
"reasoning_format", "enable_reasoning",
"use_jinja", "chat_template", "enable_chat_template",
# Server
"hostname", "port", "n_threads_http",
"hostnames", "port", "n_threads_http",
"timeout_read", "timeout_write",
"api_keys", "api_prefix",
# Misc
Expand All @@ -49,8 +48,12 @@ def main() -> None:
if cfg.get("mmproj_path"):
p.mmproj.path = cfg["mmproj_path"]
for k in SERVER_KEYS:
if k in cfg:
setattr(p, k, cfg[k])
if k not in cfg:
continue
if not hasattr(p, k):
print(f"llama_server: ignoring server key '{k}' (not supported by this xllamacpp)", file=sys.stderr)
continue
setattr(p, k, cfg[k])

server = xlc.Server(p) # noqa: F841 — held to keep the C++ server thread alive
while True:
Expand Down
2 changes: 1 addition & 1 deletion lib/task_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def generate_chat_model(file_name: str) -> ChatOpenAI:

server_cfg: dict = {
"model_path": path,
"hostname": "127.0.0.1",
"hostnames": ["127.0.0.1"],
"port": port,
"n_gpu_layers": n_gpu_layers,
"n_batch": loader_config.get("n_batch", 512),
Expand Down
Loading