node configs

This commit is contained in:
Dobromir Popov
2026-07-06 14:45:08 +03:00
parent b547034741
commit cdc9f11128
3 changed files with 19 additions and 1 deletions

View File

@@ -9,7 +9,11 @@ from pathlib import Path
_DEFAULT_CONFIG_DIR = Path.home() / ".config" / "meshnet" _DEFAULT_CONFIG_DIR = Path.home() / ".config" / "meshnet"
_DEFAULT_CONFIG_FILE = _DEFAULT_CONFIG_DIR / "config.json" _DEFAULT_CONFIG_FILE = _DEFAULT_CONFIG_DIR / "config.json"
_DEFAULT_DOWNLOAD_DIR = Path.home() / ".meshnet" / "models" # MESHNET_DOWNLOAD_DIR overrides the model store for every node on this
# machine (all CLI flows fall back to this default; --download-dir still wins).
_DEFAULT_DOWNLOAD_DIR = Path(
os.environ.get("MESHNET_DOWNLOAD_DIR", str(Path.home() / ".meshnet" / "models"))
)
_DEFAULT_TRACKER_URL = "http://localhost:8080" _DEFAULT_TRACKER_URL = "http://localhost:8080"
_DEFAULT_WALLET_PATH = str(Path.home() / ".config" / "meshnet" / "wallet.json") _DEFAULT_WALLET_PATH = str(Path.home() / ".config" / "meshnet" / "wallet.json")
_DEFAULT_QUANTIZATION = "nf4" _DEFAULT_QUANTIZATION = "nf4"

View File

@@ -19,6 +19,7 @@ dependencies = [
"transformers>=4.39", "transformers>=4.39",
"websockets>=13", "websockets>=13",
"zstandard>=0.22", "zstandard>=0.22",
"kernels>=0.11.1,<0.16",
] ]
[project.scripts] [project.scripts]

View File

@@ -1414,3 +1414,16 @@ def test_layers_from_config_get_text_config_and_variants():
cfg = types.SimpleNamespace(get_text_config=lambda: inner) cfg = types.SimpleNamespace(get_text_config=lambda: inner)
assert layers_from_config(cfg) == 32 assert layers_from_config(cfg) == 32
assert layers_from_config(types.SimpleNamespace()) is None assert layers_from_config(types.SimpleNamespace()) is None
def test_download_dir_env_override(monkeypatch):
import importlib
from meshnet_node import config as config_mod
monkeypatch.setenv("MESHNET_DOWNLOAD_DIR", "/tmp/llm-store")
importlib.reload(config_mod)
assert config_mod.DEFAULTS["download_dir"] == "/tmp/llm-store"
monkeypatch.delenv("MESHNET_DOWNLOAD_DIR")
importlib.reload(config_mod)
assert config_mod.DEFAULTS["download_dir"].endswith("models")