{"id":15396644,"url":"https://github.com/hupe1980/go-tiktoken","last_synced_at":"2025-11-07T11:02:44.688Z","repository":{"id":176768199,"uuid":"659090656","full_name":"hupe1980/go-tiktoken","owner":"hupe1980","description":"✂️  OpenAI's tiktoken tokenizer written in Go","archived":false,"fork":false,"pushed_at":"2024-05-20T16:15:46.000Z","size":3671,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-28T16:55:33.316Z","etag":null,"topics":["bpe","golang","gpt2","openai","tiktoken","tokenizer"],"latest_commit_sha":null,"homepage":"","language":"Go","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/hupe1980.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-06-27T05:58:25.000Z","updated_at":"2024-10-21T08:21:28.000Z","dependencies_parsed_at":"2024-03-28T22:36:23.613Z","dependency_job_id":"7c58810f-bf86-408a-aa7f-c9dc3e78eca9","html_url":"https://github.com/hupe1980/go-tiktoken","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":0.4117647058823529,"last_synced_commit":"9962b7e989564d2352053019d51e888370e86d57"},"previous_names":["hupe1980/go-tiktoken"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fgo-tiktoken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fgo-tiktoken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fgo-tiktoken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fgo-tiktoken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hupe1980","download_url":"https://codeload.github.com/hupe1980/go-tiktoken/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228548593,"owners_count":17935223,"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":["bpe","golang","gpt2","openai","tiktoken","tokenizer"],"created_at":"2024-10-01T15:34:27.772Z","updated_at":"2025-11-07T11:02:39.639Z","avatar_url":"https://github.com/hupe1980.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✂️ go-tiktoken\n![Build Status](https://github.com/hupe1980/go-tiktoken/workflows/build/badge.svg)\n[![Go Reference](https://pkg.go.dev/badge/github.com/hupe1980/go-tiktoken.svg)](https://pkg.go.dev/github.com/hupe1980/go-tiktoken)\n\u003e OpenAI's [tiktoken](https://github.com/openai/tiktoken) tokenizer written in Go. The vocabularies are embedded and do not need to be downloaded at runtime.\n\n## Installation\n```\ngo get github.com/hupe1980/go-tiktoken\n```\n\n## How to use\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/hupe1980/go-tiktoken\"\n)\n\nfunc main() {\n\tencoding, err := tiktoken.NewEncodingForModel(\"gpt-3.5-turbo\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tids, tokens, err := encoding.Encode(\"Hello World\", nil, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Println(\"IDs:\", ids)\n\tfmt.Println(\"Tokens:\", tokens)\n}\n```\nOutput:\n```text\nIDs: [9906 4435]\nTokens: [Hello  World]\n```\n\nFor more example usage, see [_examples](./_examples).\n\n## Supported Encodings\n- ✅ o200k_base\n- ✅ cl100k_base\n- ✅ p50k_base\n- ✅ p50k_edit\n- ✅ r50k_base\n- ✅ gpt2\n- ✅ claude\n\n## License\n[MIT](LICENCE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Fgo-tiktoken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhupe1980%2Fgo-tiktoken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Fgo-tiktoken/lists"}