Update LLM support for llama.cpp and enhance configuration management
- Added support for `llamacpp-models.yaml` in `.gitignore` and implemented logic to copy it in `gpu-rent.ps1` and `gpu-rent.sh`. - Enhanced CLI to prompt for llama.cpp model presets during setup and execution, improving user experience. - Updated configuration handling to include `llamacpp_models_manifest` and related functions for managing llama.cpp models. - Improved documentation in `cli.md` and `llm.md` to reflect changes in llama.cpp integration and model management. - Refactored provisioning logic to handle llama.cpp model downloads and configurations effectively.
This commit is contained in:
+25
-1
@@ -33,7 +33,7 @@ from gpu_rent.inventory import (
|
||||
pick_volume_type,
|
||||
resolve_flavor,
|
||||
)
|
||||
from gpu_rent.ux import print_up_preview
|
||||
from gpu_rent.ux import print_up_preview, prompt_server_plan
|
||||
from gpu_rent.pools import best_offer, format_pool_scan, scan_pools
|
||||
from gpu_rent.lock import SessionLock
|
||||
from gpu_rent.os_client import (
|
||||
@@ -173,6 +173,7 @@ def cmd_up(
|
||||
adopt: bool = False,
|
||||
update: bool | None = None,
|
||||
confirm: Callable[[str], bool] | None = None,
|
||||
ask: Callable[[str, str], str] | None = None,
|
||||
log: Log = _log_default,
|
||||
) -> SessionState:
|
||||
do_update = cfg.update_git if update is None else update
|
||||
@@ -291,6 +292,29 @@ def cmd_up(
|
||||
|
||||
print_up_preview(cfg, flavors, picked=picked, spot=spot, log=log)
|
||||
|
||||
if not yes and ask is not None and flavor is None:
|
||||
try:
|
||||
plan = prompt_server_plan(
|
||||
cfg,
|
||||
flavors,
|
||||
picked=picked,
|
||||
spot=spot,
|
||||
ask=ask,
|
||||
confirm=confirm,
|
||||
)
|
||||
except ValueError as exc:
|
||||
raise GpuRentError(str(exc)) from exc
|
||||
picked = plan.flavor
|
||||
spot = plan.spot
|
||||
if plan.data_gb != cfg.data_volume_size_gb:
|
||||
from dataclasses import replace
|
||||
|
||||
cfg = replace(cfg, data_volume_size_gb=plan.data_gb)
|
||||
log(
|
||||
f"выбрано: {'preemptible ' if spot else ''}{picked.name}, "
|
||||
f"data {cfg.data_volume_size_gb} GB"
|
||||
)
|
||||
|
||||
prompt = (
|
||||
f"Создать {'preemptible ' if spot else ''}GPU {picked.name} "
|
||||
f"в {cfg.gpu_rent_az}, образ {getattr(image, 'name', image.id)}, "
|
||||
|
||||
Reference in New Issue
Block a user