Compare commits

..

No commits in common. "9411c83a457d24b894c280fc44ebe8f66ea620c7" and "d72361cbae2f4a8e6fa3bab09f467e407142cb89" have entirely different histories.

9 changed files with 6 additions and 49 deletions

View file

@ -6,24 +6,6 @@ on:
pull_request: pull_request:
jobs: jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install package with dev extras
run: pip install -e ".[dev]"
- name: Ruff (lint)
run: ruff check src/ tests/
- name: Mypy (type check)
run: mypy
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:

View file

@ -34,8 +34,7 @@ testbar von der Orchestrierung.
1. **Eingebaute Defaults** (`config.builtin_defaults()`) — spiegeln die 1. **Eingebaute Defaults** (`config.builtin_defaults()`) — spiegeln die
Standardwerte der ursprünglichen Shell-Skripte wider (Image Standardwerte der ursprünglichen Shell-Skripte wider (Image
`ghcr.io/ggml-org/llama.cpp` per Digest gepinnt für Reproduzierbarkeit, `ghcr.io/ggml-org/llama.cpp:server-cuda`, `host_port=8001`,
`host_port=8001`,
`container_name=va_llm`, `gpu_device=1`, `jinja/fa/kv_unified/ `container_name=va_llm`, `gpu_device=1`, `jinja/fa/kv_unified/
cont_batching/no_context_shift=true`, `reasoning=on`, cont_batching/no_context_shift=true`, `reasoning=on`,
`cache_type_k/v=q4_0`, `batch_size=1024`, `ubatch_size=512`, `cache_type_k/v=q4_0`, `batch_size=1024`, `ubatch_size=512`,

View file

@ -14,9 +14,7 @@
# locking (--change), and --stop/--check targeting. # locking (--change), and --stop/--check targeting.
[default] [default]
# Pinned by digest for reproducibility. The :server-cuda tag is a moving target; image = ghcr.io/ggml-org/llama.cpp:server-cuda
# to update, pull it, read the new digest, and replace the pin below.
image = ghcr.io/ggml-org/llama.cpp@sha256:5535de118ed457f761cbfeacd7e10fef31cb391ca7cac1d5c78b11d28fcf88e6
# hf_home unterstützt Environment-Variablen und ~, z. B. hf_home = ${HF_HOME} # hf_home unterstützt Environment-Variablen und ~, z. B. hf_home = ${HF_HOME}
hf_home = /srv/models hf_home = /srv/models
model_path = qwen3/default.gguf model_path = qwen3/default.gguf

View file

@ -17,9 +17,6 @@ dependencies = [
[project.optional-dependencies] [project.optional-dependencies]
dev = [ dev = [
"pytest>=7.4", "pytest>=7.4",
"ruff>=0.6",
"mypy>=1.11",
"types-requests",
] ]
[project.scripts] [project.scripts]
@ -30,13 +27,3 @@ where = ["src"]
[tool.setuptools.package-data] [tool.setuptools.package-data]
llamacppctl = ["py.typed"] llamacppctl = ["py.typed"]
[tool.ruff]
target-version = "py310"
line-length = 100
[tool.mypy]
python_version = "3.10"
files = ["src/llamacppctl"]
warn_unused_ignores = true
warn_redundant_casts = true

View file

@ -2,6 +2,3 @@
# in pyproject.toml). # in pyproject.toml).
-r requirements.txt -r requirements.txt
pytest>=7.4 pytest>=7.4
ruff>=0.6
mypy>=1.11
types-requests

View file

@ -36,10 +36,7 @@ class ConfigError(ValueError):
def builtin_defaults() -> dict: def builtin_defaults() -> dict:
"""Mirrors the original start-llm-server.sh / status-llm-server.sh defaults.""" """Mirrors the original start-llm-server.sh / status-llm-server.sh defaults."""
return { return {
# Pinned by digest for reproducibility (the :server-cuda tag is a moving "image": "ghcr.io/ggml-org/llama.cpp:server-cuda",
# target). To update: docker pull ghcr.io/ggml-org/llama.cpp:server-cuda,
# read the new digest, and bump it here (or override `image` in the config).
"image": "ghcr.io/ggml-org/llama.cpp@sha256:5535de118ed457f761cbfeacd7e10fef31cb391ca7cac1d5c78b11d28fcf88e6",
"hf_home": "/models", "hf_home": "/models",
"model_path": "qwen3/default.gguf", "model_path": "qwen3/default.gguf",
"container_name": "va_llm", "container_name": "va_llm",

View file

@ -11,6 +11,7 @@ import shlex
import subprocess import subprocess
from dataclasses import dataclass from dataclasses import dataclass
from pathlib import Path from pathlib import Path
from typing import Optional
from .schema import ServerConfig from .schema import ServerConfig

View file

@ -8,7 +8,6 @@ from __future__ import annotations
import fcntl import fcntl
from pathlib import Path from pathlib import Path
from typing import TextIO
class LockError(RuntimeError): class LockError(RuntimeError):
@ -18,7 +17,7 @@ class LockError(RuntimeError):
class FileLock: class FileLock:
def __init__(self, path: Path): def __init__(self, path: Path):
self.path = Path(path) self.path = Path(path)
self.fd: TextIO | None = None self.fd = None
def __enter__(self) -> "FileLock": def __enter__(self) -> "FileLock":
self.path.parent.mkdir(parents=True, exist_ok=True) self.path.parent.mkdir(parents=True, exist_ok=True)

View file

@ -202,10 +202,7 @@ def _pin_dns(host: str, allowed_ips: list):
) )
return results return results
# Intentional monkeypatch: pin DNS to the pre-validated addresses for the socket.getaddrinfo = pinned
# duration of the request (SSRF/rebinding defense). Signature differs from
# the stdlib function, hence the targeted ignore.
socket.getaddrinfo = pinned # type: ignore[assignment]
try: try:
yield yield
finally: finally: