
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
JavaScript implementation of LiteLLM.
npm install litellm
import { completion } from 'litellm';
process.env['OPENAI_API_KEY'] = 'your-openai-key';
const response = await completion({
model: 'gpt-3.5-turbo',
messages: [{ content: 'Hello, how are you?', role: 'user' }],
});
// or stream the results
const stream = await completion({
model: "gpt-3.5-turbo",
messages: [{ content: "Hello, how are you?", role: "user" }],
stream: true
});
for await (const part of stream) {
process.stdout.write(part.choices[0]?.delta?.content || "");
}
We aim to support all features that LiteLLM python package supports.
| Provider | Completion | Streaming | Embedding |
|---|---|---|---|
| openai | ✅ | ✅ | ✅ |
| cohere | ✅ | ✅ | ❌ |
| anthropic | ✅ | ✅ | ❌ |
| ollama | ✅ | ✅ | ✅ |
| ai21 | ✅ | ✅ | ❌ |
| replicate | ✅ | ✅ | ❌ |
| deepinfra | ✅ | ✅ | ❌ |
| mistral | ✅ | ✅ | ✅ |
| huggingface | ❌ | ❌ | ❌ |
| together_ai | ❌ | ❌ | ❌ |
| openrouter | ❌ | ❌ | ❌ |
| vertex_ai | ❌ | ❌ | ❌ |
| palm | ❌ | ❌ | ❌ |
| baseten | ❌ | ❌ | ❌ |
| azure | ❌ | ❌ | ❌ |
| sagemaker | ❌ | ❌ | ❌ |
| bedrock | ❌ | ❌ | ❌ |
| vllm | ❌ | ❌ | ❌ |
| nlp_cloud | ❌ | ❌ | ❌ |
| aleph alpha | ❌ | ❌ | ❌ |
| petals | ❌ | ❌ | ❌ |
git clone https://github.com/zya/litellmjs.git
npm install
npm t
First copy the example env file.
cp .example.env .env
Then fill the variables with your API keys to be able to run the E2E tests.
OPENAI_API_KEY=<Your OpenAI API key>
....
Then run the command below to run the tests
npm run test:e2e
FAQs
JS Implementation of LiteLLM
The npm package litellm receives a total of 8,609 weekly downloads. As such, litellm popularity was classified as popular.
We found that litellm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.