{"id":19969309,"url":"https://github.com/vmarchaud/ts-mab","last_synced_at":"2026-06-13T09:33:27.732Z","repository":{"id":100263619,"uuid":"264677646","full_name":"vmarchaud/ts-mab","owner":"vmarchaud","description":"Typescript implementation of a multi-armed bandit","archived":false,"fork":false,"pushed_at":"2020-05-17T14:08:29.000Z","size":110,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T17:48:41.624Z","etag":null,"topics":["mab","thompson-sampling","typescript"],"latest_commit_sha":null,"homepage":"https://en.wikipedia.org/wiki/Multi-armed_bandit","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/vmarchaud.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":"2020-05-17T13:50:27.000Z","updated_at":"2024-02-25T22:03:23.000Z","dependencies_parsed_at":"2023-05-13T06:30:23.118Z","dependency_job_id":null,"html_url":"https://github.com/vmarchaud/ts-mab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vmarchaud/ts-mab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmarchaud%2Fts-mab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmarchaud%2Fts-mab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmarchaud%2Fts-mab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmarchaud%2Fts-mab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmarchaud","download_url":"https://codeload.github.com/vmarchaud/ts-mab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmarchaud%2Fts-mab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34279898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"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":["mab","thompson-sampling","typescript"],"created_at":"2024-11-13T02:49:32.831Z","updated_at":"2026-06-13T09:33:27.727Z","avatar_url":"https://github.com/vmarchaud.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi Armed Bandit\n\nWanted to test a typescript implementation and specially easily scaling it. The service in itself is stateless and push consistency the datastore, which is redis.\n\nI used the thompson-sampling implementation from [this repository](https://github.com/alextanhongpin/node-bandit) because i'm no math expert but other implemtation can be easily added (see `src/bandits/impls/`).\n\n\n# API\n\nThe service expose a simple API that expose the MAB logic so you can built on it, here are the endpoints:\n\nMethod | HTTP request | Description\n------------- | ------------- | -------------\n[**create**](#create) | **PUT** /bandits/{id} | \n[**get**](#get) | **GET** /bandits/{id} | \n[**pick**](#pick) | **GET** /bandits/{id}/pick/{pickId}?count={count} | You can use `count` if you want to make multiple pick within the same request  \n[**reward**](reward) | **GET** /bandits/{id}/reward/{arm} | \n[**update**](#update) | **POST** /bandits/{id} | \n\nAll URIs are relative to *http://localhost/api*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmarchaud%2Fts-mab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmarchaud%2Fts-mab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmarchaud%2Fts-mab/lists"}