google/codegemma-2b-gguf 2b GGUF - Free GGUF Download is indexed on GraySoft with repository links, GGUF quant files, and Hugging Face metadata. This page helps you pick a local model for guIDE or other runtimes. See related models in the same shard below.
Model Intelligence Sheet
google/codegemma-2b-gguf overview
Model Page : CodeGemma Resources and Technical Documentation : Technical Report : Responsible Generative AI Toolkit Terms of Use : Terms Authors : Google In llama.cpp, and other related tools such as Ollama and LM Studio, please make sure that you have these flags set correctly, especially repeat-penalty. Georgi Gerganov (llama.cpp's author) shared his experience in https://huggingface.co/google/gemma-7b-it/discussions/38#65d7b14adb51f7c160769fa1.
Downloads
113
Likes
35
Pipeline
text-generation
Library
llama.cpp
Visibility
Public
Access
Gated
Repository Files & Downloads
Model Details Live
Metadata Inspector
Normalized metadata (stored in metadata_json)
{
"metadata": {},
"card_data": {
"library_name": "llama.cpp",
"license": "gemma",
"license_link": "https://ai.google.dev/gemma/terms",
"pipeline_tag": "text-generation",
"extra_gated_heading": "Access CodeGemma on Hugging Face",
"extra_gated_prompt": "To access Gemma on Hugging Face, you’re required to review and agree to Google’s usage license. To do this, please ensure you’re logged-in to Hugging Face and click below. Requests are processed immediately.",
"extra_gated_button_content": "Acknowledge license",
"frontmatter": {
"library_name": "llama.cpp",
"license": "gemma",
"license_link": "https://ai.google.dev/gemma/terms",
"pipeline_tag": "text-generation",
"extra_gated_heading": "Access CodeGemma on Hugging Face",
"extra_gated_prompt": "To access Gemma on Hugging Face, you’re required to review and",
"extra_gated_button_content": "Acknowledge license"
},
"hero_image_url": "./codegemma_nl_benchmarks.png",
"summary": "Model Page : CodeGemma Resources and Technical Documentation : Technical Report : Responsible Generative AI Toolkit Terms of Use : Terms Authors : Google > [!IMPORTANT] > > In llama.cpp, and other related tools such as Ollama and LM Studio, please make sure that you have these flags set correctly, especially **repeat-penalty**. Georgi Gerganov (llama.cpp's author) shared his experience in https://huggingface.co/google/gemma-7b-it/discussions/38#65d7b14adb51f7c160769fa1.",
"quick_links": [],
"benchmark_table_html": "",
"readme_markdown": "---\nlibrary_name: llama.cpp\nlicense: gemma\nlicense_link: https://ai.google.dev/gemma/terms\npipeline_tag: text-generation\nextra_gated_heading: Access CodeGemma on Hugging Face\nextra_gated_prompt: To access Gemma on Hugging Face, you’re required to review and\n agree to Google’s usage license. To do this, please ensure you’re logged-in to Hugging\n Face and click below. Requests are processed immediately.\nextra_gated_button_content: Acknowledge license\n---\n\n# CodeGemma\n\nModel Page\n: [CodeGemma](https://ai.google.dev/gemma/docs/codegemma)\n\nResources and Technical Documentation\n: [Technical Report](https://goo.gle/codegemma)\n: [Responsible Generative AI Toolkit](https://ai.google.dev/responsible)\n\nTerms of Use\n: [Terms](https://www.kaggle.com/models/google/codegemma/license/consent/verify/huggingface?returnModelRepoId=google/codegemma-2b-GGUF)\n\nAuthors\n: Google\n\n> [!IMPORTANT]\n>\n> In llama.cpp, and other related tools such as Ollama and LM Studio, please make sure that you have these flags set correctly, especially **`repeat-penalty`**. Georgi Gerganov (llama.cpp's author) shared his experience in https://huggingface.co/google/gemma-7b-it/discussions/38#65d7b14adb51f7c160769fa1.\n \n## Model Information\n\nSummary description and brief definition of inputs and outputs.\n\n### Description\n\nCodeGemma is a collection of lightweight open code models built on top of Gemma. CodeGemma models are text-to-text and text-to-code decoder-only models and are available as a 7 billion pretrained variant that specializes in code completion and code generation tasks, a 7 billion parameter instruction-tuned variant for code chat and instruction following and a 2 billion parameter pretrained variant for fast code completion.\n\n| | [ **codegemma-2b** ](https://huggingface.co/google/codegemma-2b-GGUF) | [codegemma-7b](https://huggingface.co/google/codegemma-7b-GGUF) | [codegemma-7b-it](https://huggingface.co/google/codegemma-7b-it-GGUF) |\n|----------------------------------|:----------------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------------:|\n| Code Completion | ✅ | ✅ | |\n| Generation from natural language | | ✅ | ✅ |\n| Chat | | | ✅ |\n| Instruction Following | | | ✅ |\n\n### Sample Usage\n\n```shell\n$ cat non_prime\n/// Write a rust function to identify non-prime numbers.\n///\n/// Examples:\n/// >>> is_not_prime(2)\n/// False\n/// >>> is_not_prime(10)\n/// True\npub fn is_not_prime(n: i32) -> bool {\n$ main -m codegemma-2b.gguf --temp 0 --top-k 0 -f non_prime --log-disable --repeat-penalty 1.0\n /// Write a rust function to identify non-prime numbers.\n///\n/// Examples:\n/// >>> is_not_prime(2)\n/// False\n/// >>> is_not_prime(10)\n/// True\npub fn is_not_prime(n: i32) -> bool {\n for i in 2..n {\n if n % i == 0 {\n return true;\n }\n }\n false\n}\n<|file_separator|>\n```\n\n### Inputs and Outputs\n\nInputs\n: For pretrained model variants: code prefix and/or suffix for code completion and generation scenarios, or natural language text or prompt\n: For instruction tuned model variant: natural language text or prompt\n\nOutputs\n: For pretrained model variants: fill-in-the-middle code completion, code and natural language\n: For instruction tuned model variant: code and natural language\n\n## Model Data\n\nData used for model training and how the data was processed.\n\n### Training Dataset\n\nUsing Gemma as the base model, CodeGemma 2B and 7B pretrained variants are further trained on an additional 500 billion tokens of primarily English language data from publicly available code repositories, open source mathematics datasets and synthetically generated code.\n\n### Training Data Processing\n\nThe following data pre-processing techniques were applied:\n\n * FIM Pretrained CodeGemma models focus on fill-in-the-middle (FIM) tasks. The models are trained to work with both PSM and SPM modes. Our FIM settings are 80% FIM rate with 50-50 PSM/SPM.\n * Dependency Graph-based Packing and Unit Test-based Lexical Packing techniques: To improve model alignment with real-world applications, we structured training examples at the project/repository level to co-locate the most relevant source files within each repository. Specifically, we employed two heuristic techniques: dependency graph-based packing and unit test-based lexical packing\n * We developed a novel technique for splitting the documents into prefix, middle, and suffix to make the suffix start in a more syntactically natural point rather than purely random distribution.\n * Safety: Similarly to Gemma, we deployed rigorous safety filtering including filtering personal data, CSAM filtering and other filtering based on content quality and safety in line with [our policies](https://storage.googleapis.com/gweb-uniblog-publish-prod/documents/2023_Google_AI_Principles_Progress_Update.pdf#page=11).\n\n## Implementation Information\n\nInformation about the hardware and software used to train the models.\n\n### Hardware\n\nCodeGemma was trained using the latest generation of [Tensor Processing Unit (TPU)](https://cloud.google.com/tpu/docs/intro-to-tpu) hardware (TPUv5e).\n\n### Software\n\nTraining was done using [JAX](https://github.com/google/jax) and [ML Pathways](https://blog.google/technology/ai/introducing-pathways-next-generation-ai-architecture/).\n\n## Evaluation Information\n\nModel evaluation metrics and results.\n\n### Evaluation Approach\n\nWe evaluate CodeGemma on a variety of academic benchmarks across several domains:\n\n * Code completion benchmarks: HumanEval Single Line and Multiple Line Infilling\n * Code generation benchmarks: HumanEval, MBPP, BabelCode (C++, C#, Go, Java, JavaScript, Kotlin, Python, Rust)\n * Q&A: BoolQ, PIQA, TriviaQA\n * Natural Language: ARC-Challenge, HellaSwag, MMLU, WinoGrande\n * Math Reasoning: GSM8K, MATH\n\n### Evaluation Results\n\n#### Coding Benchmarks\n\nBenchmark | 2B | 7B | 7B-IT\n----------------------|-------|-------|------\nHumanEval | 31.1 | 44.5 | 56.1\nMBPP | 43.6 | 56.2 | 54.2\nHumanEval Single Line | 78.41 | 76.09 | 68.25\nHumanEval Multi Line | 51.44 | 58.44 | 20.05\nBC HE C++ | 24.2 | 32.9 | 42.2\nBC HE C# | 10.6 | 22.4 | 26.7\nBC HE Go | 20.5 | 21.7 | 28.6\nBC HE Java | 29.2 | 41.0 | 48.4\nBC HE JavaScript | 21.7 | 39.8 | 46.0\nBC HE Kotlin | 28.0 | 39.8 | 51.6\nBC HE Python | 21.7 | 42.2 | 48.4\nBC HE Rust | 26.7 | 34.1 | 36.0\nBC MBPP C++ | 47.1 | 53.8 | 56.7\nBC MBPP C# | 28.7 | 32.5 | 41.2\nBC MBPP Go | 45.6 | 43.3 | 46.2\nBC MBPP Java | 41.8 | 50.3 | 57.3\nBC MBPP JavaScript | 45.3 | 58.2 | 61.4\nBC MBPP Kotlin | 46.8 | 54.7 | 59.9\nBC MBPP Python | 38.6 | 59.1 | 62.0\nBC MBPP Rust | 45.3 | 52.9 | 53.5\n\n#### Natural Language Benchmarks\n\n\n\n## Ethics and Safety\n\nEthics and safety evaluation approach and results.\n\n### Evaluation Approach\n\nOur evaluation methods include structured evaluations and internal red-teaming testing of relevant content policies. Red-teaming was conducted by a number of different teams, each with different goals and human evaluation metrics. These models were evaluated against a number of different categories relevant to ethics and safety, including:\n\n * Human evaluation on prompts covering content safety and representational harms. See the [Gemma model card](https://ai.google.dev/gemma/docs/model_card#evaluation_approach) for more details on evaluation approach.\n * Specific testing of cyber-offence capabilities, focusing on testing autonomous hacking capabilities and ensuring potential harms are limited.\n\n### Evaluation Results\n\nThe results of ethics and safety evaluations are within acceptable thresholds for meeting [internal policies](https://storage.googleapis.com/gweb-uniblog-publish-prod/documents/2023_Google_AI_Principles_Progress_Update.pdf#page=11) for categories such as child safety, content safety, representational harms, memorization, large-scale harms. See the [Gemma model card](https://ai.google.dev/gemma/docs/model_card#evaluation_results) for more details.\n\n## Model Usage & Limitations\n\nThese models have certain limitations that users should be aware of.\n\n### Intended Usage\n\nCode Gemma models have a wide range of applications, which vary between IT and PT models. The following list of potential uses is not comprehensive. The purpose of this list is to provide contextual information about the possible use-cases that the model creators considered as part of model training and development.\n\nCode Completion\n: PT models can be used to complete code with an IDE extension\n\nCode Generation\n: IT model can be used to generate code with or without an IDE extension\n\nCode Conversation\n: IT model can power conversation interfaces which discuss code.\n\nCode Education\n: IT model supports interactive code learning experiences, aids in syntax correction or provides coding practice.\n\n### Known Limitations\n\nLarge Language Models (LLMs) have limitations based on their training data and the inherent limitations of the technology. See the [Gemma model card](https://ai.google.dev/gemma/docs/model_card#evaluation_results) for more details on the limitations of LLMs.\n\n### Ethical Considerations & Risks\n\nThe development of large language models (LLMs) raises several ethical concerns. We have carefully considered multiple aspects in the development of these models. Please refer to [the same discussion](https://ai.google.dev/gemma/docs/model_card#ethical_considerations_and_risks) in the Gemma model card for model details.\n\n### Benefits\n\nAt the time of release, this family of models provides high-performance open code-focused large language model implementations designed from the ground up for Responsible AI development compared to similarly sized models.\n\nUsing the coding benchmark evaluation metrics described in this document, these models have shown to provide superior performance to other, comparably-sized open model alternatives.",
"related_quantizations": []
},
"tags": [
"llama.cpp",
"gguf",
"text-generation",
"license:gemma",
"endpoints_compatible",
"region:us"
],
"likes": 35,
"downloads": 113,
"gated": true,
"private": false,
"last_modified": "2024-06-27T14:09:56.000Z",
"created_at": "2024-03-21T16:08:49.000Z",
"pipeline_tag": "text-generation",
"library_name": "llama.cpp"
}
Source payload excerpt (from Hugging Face API)
{
"_id": "65fc5b91fc9132a2df058abf",
"id": "google/codegemma-2b-GGUF",
"modelId": "google/codegemma-2b-GGUF",
"sha": "6de139035c06f87e8a46338491bfe06403f713a8",
"createdAt": "2024-03-21T16:08:49.000Z",
"lastModified": "2024-06-27T14:09:56.000Z",
"author": "google",
"downloads": 113,
"likes": 35,
"gated": true,
"private": false,
"pipeline_tag": "text-generation",
"library_name": "llama.cpp",
"siblings_count": 5
}