node configs
This commit is contained in:
@@ -9,7 +9,11 @@ from pathlib import Path
|
||||
|
||||
_DEFAULT_CONFIG_DIR = Path.home() / ".config" / "meshnet"
|
||||
_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_WALLET_PATH = str(Path.home() / ".config" / "meshnet" / "wallet.json")
|
||||
_DEFAULT_QUANTIZATION = "nf4"
|
||||
|
||||
@@ -19,6 +19,7 @@ dependencies = [
|
||||
"transformers>=4.39",
|
||||
"websockets>=13",
|
||||
"zstandard>=0.22",
|
||||
"kernels>=0.11.1,<0.16",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
|
||||
@@ -1414,3 +1414,16 @@ def test_layers_from_config_get_text_config_and_variants():
|
||||
cfg = types.SimpleNamespace(get_text_config=lambda: inner)
|
||||
assert layers_from_config(cfg) == 32
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user