{"id":28412425,"url":"https://github.com/open-webui/llama-cpp-runner","last_synced_at":"2025-06-24T06:05:57.392Z","repository":{"id":274560690,"uuid":"922366770","full_name":"open-webui/llama-cpp-runner","owner":"open-webui","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-19T02:03:02.000Z","size":24,"stargazers_count":22,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T10:05:51.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-webui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-26T02:08:44.000Z","updated_at":"2025-06-03T07:56:59.000Z","dependencies_parsed_at":"2025-01-28T09:37:31.317Z","dependency_job_id":null,"html_url":"https://github.com/open-webui/llama-cpp-runner","commit_stats":null,"previous_names":["tjbck/llama-cpp-runner","open-webui/llama-cpp-runner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/open-webui/llama-cpp-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fllama-cpp-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fllama-cpp-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fllama-cpp-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fllama-cpp-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-webui","download_url":"https://codeload.github.com/open-webui/llama-cpp-runner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fllama-cpp-runner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261618105,"owners_count":23185091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-02T21:42:06.702Z","updated_at":"2025-06-24T06:05:57.384Z","avatar_url":"https://github.com/open-webui.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦙 llama-cpp-runner\n\n`llama-cpp-runner` is the ultimate Python library for running [llama.cpp](https://github.com/ggerganov/llama.cpp) with zero hassle. It automates the process of downloading prebuilt binaries from the upstream repo, keeping you always **up to date** with the latest developments. All while requiring no complicated setups—everything works **out-of-the-box**.\n\n## Key Features 🌟\n\n1. **Always Up-to-Date**: Automatically fetches the latest prebuilt binaries from the upstream llama.cpp GitHub repo. No need to worry about staying current.\n2. **Zero Dependencies**: No need to manually install compilers or build binaries. Everything is handled for you during installation.\n3. **Model Flexibility**: Seamlessly load and serve **GGUF** models stored locally or from Hugging Face with ease.\n4. **Built-in HTTP Server**: Automatically spins up a server for chat interactions and manages idle timeouts to save resources.\n5. **Cross-Platform Support**: Works on **Windows**, **Linux**, and **macOS** with automatic detection for AVX/AVX2/AVX512/ARM architectures.\n\n\n## Why Use `llama-cpp-runner`?\n\n- **Out-of-the-box experience**: Forget about setting up complex environments for building. Just install and get started! 🛠️  \n- **Streamlined Model Serving**: Effortlessly manage multiple models and serve them with an integrated HTTP server.\n- **Fast Integration**: Use prebuilt binaries from upstream so you can spend more time building and less time troubleshooting.\n\n## Installation 🚀\n\nInstalling `llama-cpp-runner` is quick and easy! Just use pip:\n\n```bash\npip install llama-cpp-runner\n```\n\n## Optional Installation (Docker)\n\nClone the repository \n\n```bash\ngit clone https://github.com/open-webui/llama-cpp-runner\n```\n\nBuild and run\n\n```bash\ndocker compose up -d\n```\n\n## Usage 📖\n\n### Initialize the Runner\n\n```python\nfrom llama_cpp_runner import LlamaCpp\n\nllama_runner = LlamaCpp(models_dir=\"path/to/models\", verbose=True)\n\n# List all available GGUF models\nmodels = llama_runner.list_models()\nprint(\"Available Models:\", models)\n```\n\n### Chat Completion\n\n```python\nresponse = llama_runner.chat_completion({\n    \"model\": \"your-model-name.gguf\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello, Llama!\"}],\n    \"stream\": False\n})\n\nprint(response)\n```\n\n## How It Works 🛠️\n\n1. Automatically detects your system architecture (e.g., AVX, AVX2, ARM) and platform.\n2. Downloads and extracts the prebuilt llama.cpp binaries from the official repo.\n3. Spins up a lightweight HTTP server for chat interactions.\n\n## Advantages 👍\n\n- **Hassle-Free**: No need to compile binaries or manage system-specific dependencies.  \n- **Latest Features, Always**: Stay up to date with llama.cpp’s improvements with every release.  \n- **Optimized for Your System**: Automatically fetches the best binary for your architecture.\n\n## Supported Platforms 🖥️\n\n- Windows\n- macOS\n- Linux\n\n## Contributing 💻\n\nWe’d love your contributions! Bug reports, feature requests, and pull requests are all welcome. \n\n## License 📜\n\nThis library is open-source and distributed under the MIT license.  \n\nHappy chatting with llama.cpp! 🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-webui%2Fllama-cpp-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-webui%2Fllama-cpp-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-webui%2Fllama-cpp-runner/lists"}