{"id":17220891,"url":"https://github.com/kojix2/blingfire-crystal","last_synced_at":"2026-02-16T03:32:50.028Z","repository":{"id":234832812,"uuid":"622399959","full_name":"kojix2/blingfire-crystal","owner":"kojix2","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-27T03:28:38.000Z","size":62,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-27T15:53:28.608Z","etag":null,"topics":["crystal","tokenizers"],"latest_commit_sha":null,"homepage":"https://kojix2.github.io/blingfire-crystal/","language":"Crystal","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/kojix2.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}},"created_at":"2023-04-02T01:48:46.000Z","updated_at":"2026-01-27T03:28:25.000Z","dependencies_parsed_at":"2024-04-21T02:15:38.544Z","dependency_job_id":"3554c3ef-53ef-4977-89f4-8a17469ec221","html_url":"https://github.com/kojix2/blingfire-crystal","commit_stats":null,"previous_names":["kojix2/blingfire-crystal"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kojix2/blingfire-crystal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fblingfire-crystal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fblingfire-crystal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fblingfire-crystal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fblingfire-crystal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kojix2","download_url":"https://codeload.github.com/kojix2/blingfire-crystal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fblingfire-crystal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29499615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T02:07:14.481Z","status":"online","status_checked_at":"2026-02-16T02:03:22.852Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","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":["crystal","tokenizers"],"created_at":"2024-10-15T03:53:32.049Z","updated_at":"2026-02-16T03:32:49.992Z","avatar_url":"https://github.com/kojix2.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlingFire for Crystal\n\n[![build](https://github.com/kojix2/blingfire-crystal/actions/workflows/build.yml/badge.svg)](https://github.com/kojix2/blingfire-crystal/actions/workflows/build.yml)\n\nThis is a Crystal port of the [blingfire-ruby](https://github.com/ankane/blingfire-ruby). This port aims to bring the power of [BlingFire](https://github.com/microsoft/BlingFire) tokenizers to Crystalists. This library allows you to run GPT-2 tokenization compatible with [ChatGPT](https://chat.openai.com/).\n\n## Installation\n\n```sh\ngit clone https://github.com/kojix2/blingfire-crystal\ncrystal run downloader.cr\ncrystal spec\n```\n\ndownloader.cr downloads compiled libraries from [ankane/ml-builds](https://github.com/ankane/ml-builds). It also downloads [some models](https://github.com/microsoft/BlingFire/tree/master/dist-pypi/blingfire) from the official BlingFire repository.\n\n## example\n\nSee gpt2.cr in example directory\n\n```crystal\nrequire \"../src/blingfire\"\n\n# Load the model\nmodel = BlingFire::Model.new(\"gpt2.bin\")\n\n# Get the text\ntext = \"Intelligence is an accident of evolution, and not necessarily an advantage.\"\n\n# Tokenize the text\ntokens = model.text_to_ids(text)\n\n# Print the tokens\nputs tokens\n\n# Token to text\nmodel = BlingFire::Model.new(\"gpt2.i2w\")\n\n# Print the text\ntext = model.ids_to_text(tokens)\n\n# Print the text\nputs text\n```\n\n## Documentation\n\n- [blingfire-crystal](https://kojix2.github.io/blingfire-crystal/)\n\n## Development\n\nThis port is a hurried work based on ankane/blingfire-ruby. It has passed basic tests, but there might still exist some undiscovered bugs. Please use it with care and report any issues you find. Pull requests and forks are much appreciated.\n\n## License\n\nThis project is licensed under the MIT License. Please see the [LICENSE](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fblingfire-crystal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkojix2%2Fblingfire-crystal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fblingfire-crystal/lists"}