{"id":14006789,"url":"https://github.com/zya/litellmjs","last_synced_at":"2025-05-16T19:03:21.496Z","repository":{"id":198026541,"uuid":"700078531","full_name":"zya/litellmjs","owner":"zya","description":"JavaScript implementation of LiteLLM.","archived":false,"fork":false,"pushed_at":"2025-03-21T15:04:48.000Z","size":144,"stargazers_count":124,"open_issues_count":2,"forks_count":20,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-11T01:01:38.471Z","etag":null,"topics":["javascript","llama2","llm","nodejs","ollama","openai"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/zya.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-10-03T22:42:27.000Z","updated_at":"2025-05-08T16:02:25.000Z","dependencies_parsed_at":"2024-01-04T01:25:14.348Z","dependency_job_id":"98744906-cd2d-490a-ac44-044cd619b648","html_url":"https://github.com/zya/litellmjs","commit_stats":{"total_commits":90,"total_committers":5,"mean_commits":18.0,"dds":0.07777777777777772,"last_synced_commit":"60076613a3389076e926e98314868874006428fd"},"previous_names":["zya/litellmjs"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zya%2Flitellmjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zya%2Flitellmjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zya%2Flitellmjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zya%2Flitellmjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zya","download_url":"https://codeload.github.com/zya/litellmjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254592368,"owners_count":22097011,"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":["javascript","llama2","llm","nodejs","ollama","openai"],"created_at":"2024-08-10T10:01:38.449Z","updated_at":"2025-05-16T19:03:21.441Z","avatar_url":"https://github.com/zya.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  🚅 LiteLLM.js\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    \u003cp align=\"center\"\u003eJavaScript implementation of \u003ca href=\"https://github.com/BerriAI/litellm\"\u003eLiteLLM\u003c/a\u003e. \u003c/p\u003e\n\u003c/p\u003e\n\n# Usage\n\n```\nnpm install litellm\n```\n\n```ts\nimport { completion } from 'litellm';\nprocess.env['OPENAI_API_KEY'] = 'your-openai-key';\n\nconst response = await completion({\n  model: 'gpt-3.5-turbo',\n  messages: [{ content: 'Hello, how are you?', role: 'user' }],\n});\n\n// or stream the results\nconst stream = await completion({\n  model: \"gpt-3.5-turbo\",\n  messages: [{ content: \"Hello, how are you?\", role: \"user\" }],\n  stream: true\n});\n\nfor await (const part of stream) {\n  process.stdout.write(part.choices[0]?.delta?.content || \"\");\n}\n```\n\n# Features\nWe aim to support all features that [LiteLLM python package](https://github.com/BerriAI/litellm) supports.\n\n* Standardised completions\n* Standardised embeddings\n* Standardised input params 🚧 - List is [here](/docs/input-params.md)\n* Caching ❌\n* Proxy ❌\n\n## Supported Providers\n| Provider | Completion | Streaming | Embedding\n| ------------- | ------------- | ------------- | ------------- |\n| [openai](https://docs.litellm.ai/docs/providers/openai)  | ✅ | ✅  | ✅ |\n| [cohere](https://docs.litellm.ai/docs/providers/cohere)  | ✅  | ✅  | ❌ |\n| [anthropic](https://docs.litellm.ai/docs/providers/anthropic)  | ✅ | ✅ | ❌ |\n| [ollama](https://docs.litellm.ai/docs/providers/ollama)  | ✅ | ✅ | ✅ |\n| [ai21](https://docs.litellm.ai/docs/providers/ai21)  | ✅ | ✅ | ❌ |\n| [replicate](https://docs.litellm.ai/docs/providers/replicate)  | ✅ | ✅ | ❌ |\n| [deepinfra](https://docs.litellm.ai/docs/providers/deepinfra)  | ✅ | ✅ | ❌ |\n| [mistral](https://docs.litellm.ai/docs/providers/mistral)  | ✅ | ✅ | ✅ |\n| [huggingface](https://docs.litellm.ai/docs/providers/huggingface)  | ❌ | ❌ | ❌ |\n| [together_ai](https://docs.litellm.ai/docs/providers/togetherai)  | ❌ | ❌ | ❌ |\n| [openrouter](https://docs.litellm.ai/docs/providers/openrouter)  | ❌ | ❌ | ❌ |\n| [vertex_ai](https://docs.litellm.ai/docs/providers/vertex)  | ❌ | ❌ | ❌ |\n| [palm](https://docs.litellm.ai/docs/providers/palm)  | ❌ | ❌ | ❌ |\n| [baseten](https://docs.litellm.ai/docs/providers/baseten)  | ❌ | ❌ | ❌ |\n| [azure](https://docs.litellm.ai/docs/providers/azure)  | ❌ | ❌ | ❌ |\n| [sagemaker](https://docs.litellm.ai/docs/providers/aws_sagemaker)  | ❌ | ❌ | ❌ |\n| [bedrock](https://docs.litellm.ai/docs/providers/bedrock)  | ❌ | ❌ | ❌ |\n| [vllm](https://docs.litellm.ai/docs/providers/vllm)  | ❌ | ❌ | ❌ |\n| [nlp_cloud](https://docs.litellm.ai/docs/providers/nlp_cloud)  | ❌ | ❌ | ❌ |\n| [aleph alpha](https://docs.litellm.ai/docs/providers/aleph_alpha)  | ❌ | ❌ | ❌ |\n| [petals](https://docs.litellm.ai/docs/providers/petals)  | ❌ | ❌ | ❌ |\n\n# Development\n\n## Clone the repo\n```\ngit clone https://github.com/zya/litellmjs.git\n```\n\n## Install dependencies\n```\nnpm install\n```\n\n## Run unit tests\n```\nnpm t\n```\n\n## Run E2E tests\nFirst copy the example env file.\n\n```\ncp .example.env .env\n```\n\nThen fill the variables with your API keys to be able to run the E2E tests.\n\n```\nOPENAI_API_KEY=\u003cYour OpenAI API key\u003e\n....\n```\n\nThen run the command below to run the tests\n```\nnpm run test:e2e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzya%2Flitellmjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzya%2Flitellmjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzya%2Flitellmjs/lists"}