Enhance LLM runtime and installation script for Linux support
- Added a new function `pick_llamacpp_linux_asset_url` to select appropriate Linux release assets, prioritizing Ubuntu CUDA and Vulkan options while excluding Windows and macOS binaries. - Updated the installation script to build `llama-server` from source when Linux CUDA binaries are unavailable, improving compatibility and flexibility. - Revised documentation to reflect changes in asset handling and installation procedures. - Added tests to validate the new asset selection logic, ensuring correct behavior in various scenarios.
This commit is contained in:
@@ -7,6 +7,7 @@ from gpu_rent.llm_runtime import (
|
||||
normalize_runtime,
|
||||
parse_llamacpp_models,
|
||||
parse_ollama_models,
|
||||
pick_llamacpp_linux_asset_url,
|
||||
remap_llamacpp_url,
|
||||
write_ollama_models_preset,
|
||||
)
|
||||
@@ -86,3 +87,39 @@ def test_remap_dead_bartowski_abliterate_url(tmp_path: Path):
|
||||
entries = parse_llamacpp_models(path)
|
||||
assert len(entries) == 1
|
||||
assert entries[0].url == fixed
|
||||
|
||||
|
||||
def test_pick_llamacpp_linux_asset_skips_windows_cuda():
|
||||
assets = [
|
||||
{
|
||||
"name": "cudart-llama-bin-win-cuda-12.4-x64.zip",
|
||||
"browser_download_url": "https://example/cudart-win.zip",
|
||||
},
|
||||
{
|
||||
"name": "llama-b10545-bin-win-cuda-12.4-x64.zip",
|
||||
"browser_download_url": "https://example/win-cuda.zip",
|
||||
},
|
||||
{
|
||||
"name": "llama-b10545-bin-ubuntu-x64.tar.gz",
|
||||
"browser_download_url": "https://example/ubuntu-cpu.tar.gz",
|
||||
},
|
||||
{
|
||||
"name": "llama-b10545-bin-ubuntu-vulkan-x64.tar.gz",
|
||||
"browser_download_url": "https://example/ubuntu-vulkan.tar.gz",
|
||||
},
|
||||
]
|
||||
assert pick_llamacpp_linux_asset_url(assets) == "https://example/ubuntu-vulkan.tar.gz"
|
||||
|
||||
|
||||
def test_pick_llamacpp_linux_asset_prefers_ubuntu_cuda():
|
||||
assets = [
|
||||
{
|
||||
"name": "llama-b1-bin-ubuntu-vulkan-x64.tar.gz",
|
||||
"browser_download_url": "https://example/vulkan.tar.gz",
|
||||
},
|
||||
{
|
||||
"name": "llama-b1-bin-ubuntu-cuda-12.4-x64.tar.gz",
|
||||
"browser_download_url": "https://example/cuda.tar.gz",
|
||||
},
|
||||
]
|
||||
assert pick_llamacpp_linux_asset_url(assets) == "https://example/cuda.tar.gz"
|
||||
|
||||
Reference in New Issue
Block a user