%global pypi_name llama-cpp-python %global pypi_version 0.2.60 Name: python-%{pypi_name} Version: %{pypi_version} Release: %autorelease License: MIT Summary: Simple Python bindings for @ggerganov's llama.cpp library URL: https://github.com/abetlen/llama-cpp-python Source: %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz Patch1: 0001-don-t-build-llama.cpp-and-llava.patch %bcond_with test BuildArch: noarch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: ninja-build BuildRequires: python3-devel BuildRequires: llama-cpp Requires: llama-cpp %generate_buildrequires %pyproject_buildrequires %description %{pypi_name} provides: Low-level access to C API via `ctypes` interface. High-level Python API for text completion. OpenAI compatible web server %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{pypi_name} provides: Low-level access to C API via `ctypes` interface. High-level Python API for text completion. OpenAI compatible web server %prep %autosetup -p1 -n %{pypi_name}-%{version} %build %pyproject_wheel %if %{with test} %check %pytest -sv %endif %install %pyproject_install %pyproject_save_files -l llama_cpp %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE.md %doc README.md %changelog %autochangelog