Enhance Ollama model management and performance tuning
- Updated the `provision_llm` function to utilize the `/api/tags` endpoint for verifying available models, improving accuracy in model management. - Introduced a new `already_have_ollama_tag` function to ensure exact tag matching, preventing mismatches during model checks. - Enhanced the `pull_stream` function to require a successful status from the API before proceeding, ensuring reliable model downloads. - Added logic to handle unwritten blob files, improving the robustness of the model pulling process. - Updated documentation and tests to reflect these changes, ensuring clarity and reliability in Ollama model operations.
This commit is contained in:
@@ -88,6 +88,18 @@ def test_install_ollama_skips_restart_when_unit_unchanged():
|
||||
assert "skip restart" in text
|
||||
|
||||
|
||||
def test_provision_llm_skips_on_api_tags_not_cli_list():
|
||||
from pathlib import Path
|
||||
|
||||
from gpu_rent import provision
|
||||
|
||||
text = Path(provision.__file__).read_text(encoding="utf-8")
|
||||
assert "_ollama_api_tags" in text
|
||||
assert "awk 'NR>1" not in text
|
||||
assert "GPU не гасим" in text
|
||||
assert "без моделей из ollama-models.yaml" not in text
|
||||
|
||||
|
||||
def test_cli_has_update_flag():
|
||||
from gpu_rent import cli
|
||||
|
||||
|
||||
Reference in New Issue
Block a user