{"id":26829612,"url":"https://github.com/brianprost/bedrock-abacus","last_synced_at":"2025-09-04T19:45:47.563Z","repository":{"id":283314424,"uuid":"951347396","full_name":"brianprost/bedrock-abacus","owner":"brianprost","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-30T16:26:27.000Z","size":41935,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-15T22:42:24.017Z","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/brianprost.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,"zenodo":null}},"created_at":"2025-03-19T14:37:21.000Z","updated_at":"2025-04-02T13:48:45.000Z","dependencies_parsed_at":"2025-03-19T16:26:17.460Z","dependency_job_id":"74375d5e-3e47-4a20-8da8-97c08a190011","html_url":"https://github.com/brianprost/bedrock-abacus","commit_stats":null,"previous_names":["brianprost/bedrock-abacus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brianprost/bedrock-abacus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianprost%2Fbedrock-abacus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianprost%2Fbedrock-abacus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianprost%2Fbedrock-abacus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianprost%2Fbedrock-abacus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianprost","download_url":"https://codeload.github.com/brianprost/bedrock-abacus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianprost%2Fbedrock-abacus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273665995,"owners_count":25146273,"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-09-04T02:00:08.968Z","response_time":61,"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":[],"created_at":"2025-03-30T13:17:46.334Z","updated_at":"2025-09-04T19:45:42.508Z","avatar_url":"https://github.com/brianprost.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bedrock Abacus\n\nA TypeScript utility for calculating token counts and pricing for Amazon Bedrock\nmodels.\n\n\u003e **Note:** Pricing is as of\n\u003e [2025-03-19](https://aws.amazon.com/bedrock/pricing/)\n\n## Features\n\n- Calculate token counts for text input\n- Calculate pricing for Amazon Bedrock models\n- Support for both standard and batch pricing\n- Support for popular models including:\n  - Claude 3.* Sonnet\n  - Claude 3.6 Haiku\n  - Claude 3 Opus\n  - Llama3.3 70B\n  - Llama3.2 11B\n  - Amazon Nova Pro and Lite\n\n## Installation\n\nYou can use Bedrock Abacus directly in your project:\n\n```ts\nimport { calculate, countTokens, MODELS } from \"bedrock-abacus\";\n```\n\n## Usage\n\n### Calculating Token Count and Pricing\n\n```ts\nimport { calculate, countTokens, MODELS } from \"bedrock-abacus\";\n\n// Calculate pricing based on text\nconst result = calculate({\n\ttext: \"You picked the right time but the wrong guy.\",\n\toptions: {\n\t\tmodelId: MODELS[\"Claude 3.5 Sonnet\"],\n\t\tbatch: false,\n\t},\n});\n\nconsole.log(`Token count: ${result.tokenCount}`);\nconsole.log(`Input cost: $${result.pricing.pricing.input.toFixed(6)}`);\nconsole.log(`Output cost: $${result.pricing.pricing.output.toFixed(6)}`);\n\n// Or calculate pricing based on token count\nconst result2 = calculate({\n\ttokenCount: 1000,\n\toptions: {\n\t\tmodelId: MODELS[\"Llama3.3 70B\"],\n\t\tbatch: true,\n\t},\n});\n```\n\n### Get Token Count Only\n\n```ts\nimport { countTokens } from \"bedrock-abacus\";\n\nconst count = countTokens(\"Scorekeeper, deduct one life.\");\nconsole.log(`Token count: ${count}`);\n```\n\n### Available Models\n\nThe library includes all current Amazon Bedrock models with their IDs and\npricing:\n\n```ts\nimport { MODELS, PRICING } from \"bedrock-abacus\";\n\n// Access model IDs\nconsole.log(MODELS[\"Claude 3.5 Sonnet\"]);\n\n// Access pricing\nconst pricingInfo = PRICING[\"Claude 3.5 Sonnet\"];\nconsole.log(`Standard input: $${pricingInfo.standard.input} per 1K tokens`);\nconsole.log(`Standard output: $${pricingInfo.standard.output} per 1K tokens`);\n```\n\n## Development\n\n```bash\n# Run the development server\ndeno task dev\n\n# Run tests\ndeno test\n```\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Plz help\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianprost%2Fbedrock-abacus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianprost%2Fbedrock-abacus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianprost%2Fbedrock-abacus/lists"}