{"id":21140668,"url":"https://github.com/cztomsik/ggml-js","last_synced_at":"2025-10-15T13:11:06.212Z","repository":{"id":153728750,"uuid":"630458056","full_name":"cztomsik/ggml-js","owner":"cztomsik","description":"JavaScript bindings for the ggml-js library","archived":false,"fork":false,"pushed_at":"2025-03-24T07:38:52.000Z","size":100,"stargazers_count":43,"open_issues_count":3,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-29T05:45:20.783Z","etag":null,"topics":["ggml","machine-learning","node-js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/cztomsik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-04-20T12:28:08.000Z","updated_at":"2025-04-10T03:48:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc7056e1-ffeb-46aa-8e26-3da99480f27e","html_url":"https://github.com/cztomsik/ggml-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cztomsik/ggml-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cztomsik%2Fggml-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cztomsik%2Fggml-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cztomsik%2Fggml-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cztomsik%2Fggml-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cztomsik","download_url":"https://codeload.github.com/cztomsik/ggml-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cztomsik%2Fggml-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268625009,"owners_count":24280188,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"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":["ggml","machine-learning","node-js"],"created_at":"2024-11-20T07:17:07.570Z","updated_at":"2025-10-15T13:11:01.173Z","avatar_url":"https://github.com/cztomsik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e This project is temporarily **on hold**.\\\n\u003e I am now working on **[Ava, Personal Language Server](https://www.avapls.com/)**, a GUI app for running LLMs.\n\n# ggml-js\n\nJavaScript bindings for the [GGML](https://github.com/ggerganov/ggml) library, a\nfast and lightweight tensor/machine-learning library implemented in C.\n\n[RWKV example](https://github.com/cztomsik/ggml-js/blob/main/examples/rwkv.js)\n\nhttps://user-images.githubusercontent.com/3526922/236536800-fca4d729-3479-471a-aea5-2d0ae5df3fdf.mov\n\n## Installation\n\nYou can install ggml-js via npm:\n\n```bash\nnpm install ggml-js\n```\n\n## Basic Usage\n\nHere's an example of how to use ggml-js in your JavaScript code:\n\n```js\nimport { Context, F } from 'ggml-js/core'\n\n// Create context, two 1D tensors and multiply them\nconst ctx = Context.init()\nconst a = ctx.newTensor1D('f32', 1)\nconst b = ctx.newTensor1D('f32', 1)\nconst ab = F.mul(a, b)\n\n// Build the computation graph\nconst graph = ctx.buildForward(ab)\n\n// Set values \u0026 compute the graph\na.set(0, 1.5)\nb.set(0, 2)\ngraph.compute()\n\n// Get result\nconsole.log(ab.get(0))\n```\n\n## Advanced Usage\n\nggml-js also provides modules for working with pre-trained models and tokenizers. Here's an example of how to use the RWKV model and BPETokenizer:\n\n```js\nimport { RWKV } from 'ggml-js/llms'\nimport { BPETokenizer } from 'ggml-js/tokenizers'\n\n// see examples/rwkv.js for full example\nconst model = RWKV.loadFromFile(...)\nconst tokenizer = BPETokenizer.loadFromFile(...)\n\nfor (const t of model.generate(tokenizer.encode('Hello world!'))) {\n  process.stdout.write(tokenizer.decodeOne(t))\n}\n```\n\n## Building From Source\n\nIf you want to build ggml-js from source, you can clone the repository and run the following commands:\n\n```bash\nzig build\n```\n\n## License\n\nThis project is licensed under the MIT License.\n\nThis project bundles [GGML](https://github.com/ggerganov/ggml) library by **Georgi Gerganov**, which is also licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcztomsik%2Fggml-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcztomsik%2Fggml-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcztomsik%2Fggml-js/lists"}