{"id":15064339,"url":"https://github.com/pond918/llm-bots","last_synced_at":"2025-04-10T11:51:33.782Z","repository":{"id":170065618,"uuid":"645560059","full_name":"pond918/llm-bots","owner":"pond918","description":"npm package of llm bots with tree-structured chat histories. can be deployed on local browser, or node server with shared sessions and isolated user states.","archived":false,"fork":false,"pushed_at":"2025-03-24T07:18:48.000Z","size":3846,"stargazers_count":1,"open_issues_count":17,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T08:31:18.788Z","etag":null,"topics":["alpaca","bard","bingchat","chatbot","chatglm","chatgpt","claude","ernie","iflytek","llm","moss"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pond918.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-05-25T23:51:32.000Z","updated_at":"2023-05-30T13:41:25.000Z","dependencies_parsed_at":"2024-12-16T07:30:17.906Z","dependency_job_id":"c4eabbaa-6462-4124-a9b7-b65ff4fe19dd","html_url":"https://github.com/pond918/llm-bots","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"2ee86bbc995f6c372accf9b6a258289b38578fa1"},"previous_names":["pond918/llm-bots"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pond918%2Fllm-bots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pond918%2Fllm-bots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pond918%2Fllm-bots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pond918%2Fllm-bots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pond918","download_url":"https://codeload.github.com/pond918/llm-bots/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248215191,"owners_count":21066621,"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":["alpaca","bard","bingchat","chatbot","chatglm","chatgpt","claude","ernie","iflytek","llm","moss"],"created_at":"2024-09-25T00:15:47.864Z","updated_at":"2025-04-10T11:51:33.759Z","avatar_url":"https://github.com/pond918.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM bots\n\n[![Actions Status](https://github.com/pond918/llm-bots/workflows/ci/badge.svg)](https://github.com/pond918/llm-bots/actions)\n[![npm](https://img.shields.io/npm/v/@pond918/llm-bots.svg)](https://www.npmjs.com/package/@pond918/llm-bots)\n[![Known Vulnerabilities](https://snyk.io/test/github/pond918/llm-bots/badge.svg?targetFile=package.json)](https://snyk.io/test/github/pond918/llm-bots?targetFile=package.json)\n[![prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier)\n[![license](https://img.shields.io/npm/l/l@pond918/lm-bots.svg)](https://www.npmjs.com/package/@pond918/llm-bots)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fpond918%2Fllm-bots.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fpond918%2Fllm-bots?ref=badge_shield)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n\n## What is it?\n\nAn npm package of many large language model (LLMs) client chat bots, e.g. ChatGPT, Bing Chat, bard, Alpaca, Vincuna, Claude, ChatGLM, MOSS, iFlytek Spark, ERNIE and more. You may register your own bots easily.\n\nThe package enables bots to support unlimited conversations. each conversation has tree-structured chat history ( each chat message has a `lastMsgId`).\n\nAnother use case is to isolate different users for the same bot on the same nodejs server. All user related data: session/conversation/chat history, etc. is stored in the specified BotStorage on different namespaces.\n\n## Getting Started\n\n### Install the library\n\n```sh\nnpm install --save @pond918/llm-bots\n```\n\n### using the bots\n\n```typescript\nimport { ChatDto, LLMBots } from '@pond918/llm-bots'\n\nconst bots = new LLMBots()\nconst claudeBot = bots.instance('vicuna-13b')\n// vicuna-13b needn't token\nconst token = null\nconst ready = await claudeBot?.initSession(token)\nif (ready) {\n  const resp = await claudeBot?.sendPrompt(new ChatDto('hi there. 1 word most'))\n  console.log(resp)\n\n  // stream response\n  claudeBot?.sendPrompt(new ChatDto('who is Gauss. 5 words most'), (msg) =\u003e console.log(msg))\n}\n```\n\n### register a new bot\n\n```typescript\nimport { LLMBots } from '@pond918/llm-bots'\n\n// you may apply a custom user data storage\nconst bots = LLMBots.factory(storage);\n\n// new bot will replace old bot with same name.\nbots.register(new MyLLMBot());\n\nconst models = LLMBots.list();\nconsole.log(Object.keys(models));\n```\n\n## bot state management\n\nThere are 3 state for an llm bot instance:\n\n- llm config state: e.g. llm url. Stored as bot class properties.\n- server session state: API tokens/login sessions. Stored in the session pool, may be shared among users.\n- user data state: conversation/chat history. Stored in the provided storage, usually users isolated.\n\n## TODOs\n\n- [ ] namespaced/scoped storage\n\n## License\n\nThis project is [Apache-2.0 Licensed](LICENSE).\n\n## Credits\n\n- bots implementation are based on [ChatAll](https://github.com/sunner/ChatALL). Respect!\n- [NodeJS Starter ToolKit](https://github.com/vitorsalgado/create-nodejs-ts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpond918%2Fllm-bots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpond918%2Fllm-bots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpond918%2Fllm-bots/lists"}