{"id":16247953,"url":"https://github.com/jcblw/gemma-node","last_synced_at":"2025-04-08T12:17:35.736Z","repository":{"id":224964663,"uuid":"764714471","full_name":"jcblw/gemma-node","owner":"jcblw","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-10T22:39:48.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T08:17:04.257Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcblw.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":"2024-02-28T15:26:54.000Z","updated_at":"2024-02-28T15:30:03.000Z","dependencies_parsed_at":"2024-02-28T16:45:45.498Z","dependency_job_id":"b9bebf34-2356-411b-917d-6d3da4191b95","html_url":"https://github.com/jcblw/gemma-node","commit_stats":null,"previous_names":["jcblw/gemma-node"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcblw%2Fgemma-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcblw%2Fgemma-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcblw%2Fgemma-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcblw%2Fgemma-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcblw","download_url":"https://codeload.github.com/jcblw/gemma-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838447,"owners_count":21004580,"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":"2024-10-10T14:39:23.866Z","updated_at":"2025-04-08T12:17:35.703Z","avatar_url":"https://github.com/jcblw.png","language":"TypeScript","readme":"# Gemma Node\n\nThis is a module that will interface with [Gemma](https://blog.google/technology/developers/gemma-open-models/)'s [gemma.cpp](https://github.com/google/gemma.cpp). Its still a work in progress.\n\n## Installation\n\nFirst with the current version you will need to clone the [`gemma.cpp`](https://github.com/google/gemma.cpp) repo, and build the library. You will also need to download the model files from [Kaggle](https://www.kaggle.com/models/google/gemma).\n\n### To install this package, run:\n\n```bash\nyarn add gemma-node\n```\n\n## Usage\n\n### Configuring Gemma\n\n```ts\nimport { Gemma } from 'gemma-node'\n\nconst gemma = new Gemma({\n  directory: 'path/to/gemma.cpp/build/', // or process.env.GEMMA_DIR\n  tokenizer: 'tokenizer.spm ', // will resolve path based on directory\n  model: '2b-it',\n  compressedWeights: '2b-it-sfp.sbs', // will resolve path based on directory\n})\n```\n\n### Using Gemma\n\n```ts\nawait gemma.start()\n```\n\nThis will start up the Gemma process and load the model. This is required and once the promise is resolves you are ready to send input to the model.\n\n#### Async methods\n\n```ts\nconst input = 'This is a test'\nconst output = await gemma.sendMessageAsync(input)\nconsole.log(output.join(' '))\n```\n\nThere right now is only one way to send input, and receive output. This is the async method that uses async await. THe awaited output will be an array of strings.\n\n#### Stream methods\n\nComing soon\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcblw%2Fgemma-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcblw%2Fgemma-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcblw%2Fgemma-node/lists"}