{"id":51509245,"url":"https://github.com/eullm/llama-cpp-rs","last_synced_at":"2026-07-08T04:30:19.211Z","repository":{"id":369642545,"uuid":"1276114261","full_name":"eullm/llama-cpp-rs","owner":"eullm","description":"EU-hosted daily mirror of utilityai/llama-cpp-rs — not a fork","archived":false,"fork":false,"pushed_at":"2026-07-06T07:57:39.000Z","size":4325,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-06T09:20:13.058Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eullm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-21T14:58:51.000Z","updated_at":"2026-07-06T07:55:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eullm/llama-cpp-rs","commit_stats":null,"previous_names":["eullm/llama-cpp-rs"],"tags_count":152,"template":false,"template_full_name":null,"purl":"pkg:github/eullm/llama-cpp-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eullm%2Fllama-cpp-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eullm%2Fllama-cpp-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eullm%2Fllama-cpp-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eullm%2Fllama-cpp-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eullm","download_url":"https://codeload.github.com/eullm/llama-cpp-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eullm%2Fllama-cpp-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35252324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-07-08T04:30:16.427Z","updated_at":"2026-07-08T04:30:19.197Z","avatar_url":"https://github.com/eullm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦙 [llama-cpp-rs][readme] \u0026emsp; [![Docs]][docs.rs] [![Latest Version]][crates.io] [![Lisence]][crates.io]\n\n[Docs]: https://img.shields.io/docsrs/llama-cpp-2.svg\n\n[Latest Version]: https://img.shields.io/crates/v/llama-cpp-2.svg\n\n[crates.io]: https://crates.io/crates/llama-cpp-2\n\n[docs.rs]: https://docs.rs/llama-cpp-2\n\n[Lisence]: https://img.shields.io/crates/l/llama-cpp-2.svg\n\n[llama-cpp-sys]: https://crates.io/crates/llama-cpp-sys-2\n\n[utilityai]: https://utilityai.ca\n\n[readme]: https://github.com/utilityai/llama-cpp-rs/tree/main/llama-cpp-2\n\nThis is the home for [llama-cpp-2][crates.io]. It also contains the [llama-cpp-sys] bindings which are updated semi-regularly\nand in sync with [llama-cpp-2][crates.io].\n\nThis project was created with the explict goal of staying as up to date as possible with llama.cpp, as a result it is\ndead simple, very close to raw bindings, and does not follow semver meaningfully.\n\nCheck out the [docs.rs] for crate documentation or the [readme] for high level information about the project.\n\n## Try it\n\nWe maintain a super simple example of using the library:\n\nClone the repo\n\n```bash\ngit clone --recursive https://github.com/utilityai/llama-cpp-rs\ncd llama-cpp-rs\n```\n\nRun the simple example (add `--features cuda` if you have a cuda gpu)\n\n```bash\ncargo run --release --bin simple -- --prompt \"The way to kill a linux process is\" hf-model TheBloke/Llama-2-7B-GGUF llama-2-7b.Q4_K_M.gguf\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eOutput\u003c/summary\u003e\n\u003cpre\u003e\nggml_init_cublas: GGML_CUDA_FORCE_MMQ:   no\nggml_init_cublas: CUDA_USE_TENSOR_CORES: yes\nggml_init_cublas: found 1 CUDA devices:\n  Device 0: NVIDIA GeForce RTX 3090, compute capability 8.6, VMM: yes\nllama_model_params { n_gpu_layers: 1000, split_mode: 1, main_gpu: 0, tensor_split: 0x0, progress_callback: None, progress_callback_user_data: 0x0, kv_overrides: 0x0, vocab_only: false, use_mmap: true, use_mlock: false }\nllama_model_loader: loaded meta data with 19 key-value pairs and 291 tensors from /home/marcus/.cache/huggingface/hub/models--TheBloke--Llama-2-7B-GGUF/snapshots/b4e04e128f421c93a5f1e34ac4d7ca9b0af47b80/llama-2-7b.Q4_K_M.gguf (version GGUF V2)\nllama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.\nllama_model_loader: - kv   0:                       general.architecture str              = llama\nllama_model_loader: - kv   1:                               general.name str              = LLaMA v2\nllama_model_loader: - kv   2:                       llama.context_length u32              = 4096\nllama_model_loader: - kv   3:                     llama.embedding_length u32              = 4096\nllama_model_loader: - kv   4:                          llama.block_count u32              = 32\nllama_model_loader: - kv   5:                  llama.feed_forward_length u32              = 11008\nllama_model_loader: - kv   6:                 llama.rope.dimension_count u32              = 128\nllama_model_loader: - kv   7:                 llama.attention.head_count u32              = 32\nllama_model_loader: - kv   8:              llama.attention.head_count_kv u32              = 32\nllama_model_loader: - kv   9:     llama.attention.layer_norm_rms_epsilon f32              = 0.000010\nllama_model_loader: - kv  10:                          general.file_type u32              = 15\nllama_model_loader: - kv  11:                       tokenizer.ggml.model str              = llama\nllama_model_loader: - kv  12:                      tokenizer.ggml.tokens arr[str,32000]   = [\"\u003cunk\u003e\", \"\u003cs\u003e\", \"\u003c/s\u003e\", \"\u003c0x00\u003e\", \"\u003c...\nllama_model_loader: - kv  13:                      tokenizer.ggml.scores arr[f32,32000]   = [0.000000, 0.000000, 0.000000, 0.0000...\nllama_model_loader: - kv  14:                  tokenizer.ggml.token_type arr[i32,32000]   = [2, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, ...\nllama_model_loader: - kv  15:                tokenizer.ggml.bos_token_id u32              = 1\nllama_model_loader: - kv  16:                tokenizer.ggml.eos_token_id u32              = 2\nllama_model_loader: - kv  17:            tokenizer.ggml.unknown_token_id u32              = 0\nllama_model_loader: - kv  18:               general.quantization_version u32              = 2\nllama_model_loader: - type  f32:   65 tensors\nllama_model_loader: - type q4_K:  193 tensors\nllama_model_loader: - type q6_K:   33 tensors\nllm_load_vocab: special tokens definition check successful ( 259/32000 ).\nllm_load_print_meta: format           = GGUF V2\nllm_load_print_meta: arch             = llama\nllm_load_print_meta: vocab type       = SPM\nllm_load_print_meta: n_vocab          = 32000\nllm_load_print_meta: n_merges         = 0\nllm_load_print_meta: n_ctx_train      = 4096\nllm_load_print_meta: n_embd           = 4096\nllm_load_print_meta: n_head           = 32\nllm_load_print_meta: n_head_kv        = 32\nllm_load_print_meta: n_layer          = 32\nllm_load_print_meta: n_rot            = 128\nllm_load_print_meta: n_embd_head_k    = 128\nllm_load_print_meta: n_embd_head_v    = 128\nllm_load_print_meta: n_gqa            = 1\nllm_load_print_meta: n_embd_k_gqa     = 4096\nllm_load_print_meta: n_embd_v_gqa     = 4096\nllm_load_print_meta: f_norm_eps       = 0.0e+00\nllm_load_print_meta: f_norm_rms_eps   = 1.0e-05\nllm_load_print_meta: f_clamp_kqv      = 0.0e+00\nllm_load_print_meta: f_max_alibi_bias = 0.0e+00\nllm_load_print_meta: n_ff             = 11008\nllm_load_print_meta: n_expert         = 0\nllm_load_print_meta: n_expert_used    = 0\nllm_load_print_meta: rope scaling     = linear\nllm_load_print_meta: freq_base_train  = 10000.0\nllm_load_print_meta: freq_scale_train = 1\nllm_load_print_meta: n_yarn_orig_ctx  = 4096\nllm_load_print_meta: rope_finetuned   = unknown\nllm_load_print_meta: model type       = 7B\nllm_load_print_meta: model ftype      = Q4_K - Medium\nllm_load_print_meta: model params     = 6.74 B\nllm_load_print_meta: model size       = 3.80 GiB (4.84 BPW) \nllm_load_print_meta: general.name     = LLaMA v2\nllm_load_print_meta: BOS token        = 1 '\u003cs\u003e'\nllm_load_print_meta: EOS token        = 2 '\u003c/s\u003e'\nllm_load_print_meta: UNK token        = 0 '\u003cunk\u003e'\nllm_load_print_meta: LF token         = 13 '\u003c0x0A\u003e'\nllm_load_tensors: ggml ctx size =    0.22 MiB\nllm_load_tensors: offloading 32 repeating layers to GPU\nllm_load_tensors: offloading non-repeating layers to GPU\nllm_load_tensors: offloaded 33/33 layers to GPU\nllm_load_tensors:      CUDA0 buffer size =  3820.94 MiB\nllm_load_tensors:        CPU buffer size =    70.31 MiB\n..................................................................................................\nLoaded \"/home/marcus/.cache/huggingface/hub/models--TheBloke--Llama-2-7B-GGUF/snapshots/b4e04e128f421c93a5f1e34ac4d7ca9b0af47b80/llama-2-7b.Q4_K_M.gguf\"\nllama_new_context_with_model: n_ctx      = 2048\nllama_new_context_with_model: freq_base  = 10000.0\nllama_new_context_with_model: freq_scale = 1\nllama_kv_cache_init:      CUDA0 KV buffer size =  1024.00 MiB\nllama_new_context_with_model: KV self size  = 1024.00 MiB, K (f16):  512.00 MiB, V (f16):  512.00 MiB\nllama_new_context_with_model:  CUDA_Host input buffer size   =    13.02 MiB\nggml_gallocr_reserve_n: reallocating CUDA0 buffer from size 0.00 MiB to 164.01 MiB\nggml_gallocr_reserve_n: reallocating CUDA_Host buffer from size 0.00 MiB to 8.00 MiB\nllama_new_context_with_model:      CUDA0 compute buffer size =   164.01 MiB\nllama_new_context_with_model:  CUDA_Host compute buffer size =     8.00 MiB\nllama_new_context_with_model: graph splits (measure): 3\nn_len = 32, n_ctx = 2048, k_kv_req = 32\n\nThe way to kill a linux process is to send it a SIGKILL signal.\nThe way to kill a windows process is to send it a S\n\ndecoded 24 tokens in 0.23 s, speed 105.65 t/s\n\nload time = 727.50 ms\nsample time = 0.46 ms / 24 runs (0.02 ms per token, 51835.85 tokens per second)\nprompt eval time = 68.52 ms / 9 tokens (7.61 ms per token, 131.35 tokens per second)\neval time = 225.70 ms / 24 runs (9.40 ms per token, 106.34 tokens per second)\ntotal time = 954.18 ms\n\u003c/pre\u003e\n\u003c/details\u003e\n\n## Hacking\n\nEnsure that when you clone this project you also clone the submodules. This can be done with the following command:\n\n```sh\ngit clone --recursive https://github.com/utilityai/llama-cpp-rs\n```\n\nor if you have already cloned the project you can run:\n\n```sh\ngit submodule update --init --recursive\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feullm%2Fllama-cpp-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feullm%2Fllama-cpp-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feullm%2Fllama-cpp-rs/lists"}