# arpk

> LLM as your translator, with DeepLX-compatible API.

Latest version **0.4.0** (published 2026-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install arpk
pnpm add arpk
yarn add arpk
bun add arpk
```

Provides the command `arpk`.

## Health

**Score 55/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities; has provenance.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2026-01-08 |
| First published | 2024-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 28.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 42 |
| Maintainers | kwaa |
| Keywords | translator, translation |

## Links

- npm: https://www.npmjs.com/package/arpk
- Repository: https://github.com/moeru-ai/arpk
- Issues: https://github.com/moeru-ai/arpk/issues
- npm.io page: https://npm.io/package/arpk

## Dependencies (2)

- [srvx](https://npm.io/package/srvx.md) ^0.10.0
- [cleye](https://npm.io/package/cleye.md) ^2.2.1

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2026-01-08
- 0.3.0 — 2025-03-04
- 0.3.0-beta.6 — 2025-03-04
- 0.3.0-beta.4 — 2024-12-25
- 0.3.0-beta.3 — 2024-12-09
- 0.3.0-beta.2 — 2024-11-26
- 0.3.0-beta.1 — 2024-11-26
- 0.2.4 — 2024-11-10
- 0.2.3 — 2024-11-10
- 0.2.2 — 2024-11-10
- 0.2.1 — 2024-11-09
- 0.1.5 — 2024-10-30
- 0.1.4 — 2024-10-30
- 0.1.3 — 2024-10-30
- 0.1.2 — 2024-09-27
- … 6 more at https://npm.io/package/arpk/versions

## README

# ARPK [![npm](https://img.shields.io/npm/v/arpk)](https://npmjs.com/package/arpk)

> LLM as your translator, with DeepLX-compatible API.

## Usage

### Prepare

ARPK supports most OpenAI-compatible APIs, [Ollama](https://ollama.com/) is used here as an example (and is also the default):

```bash
ollama serve
ollama pull llama3.2
```

### Install

First install [Node.js](https://nodejs.org), then install ARPK via your favorite package manager (or npm).

```bash
npm i -g arpk
```

You can also use ARPK via `npx` without installing it:

```bash
npx -y arpk
```

### Translate

```bash
arpk translate --from "EN-US" --to "ZH" --input "Hello, World!"
# 你好，世界！

echo "Hello, World!" | arpk translate --from "EN-US" --to "JA"
# こんにちは、世界！
```

### Serve

```bash
ARPK_LLM_MODEL="llama3.2" arpk serve
```

#### npx

```bash
ARPK_LLM_MODEL="llama3.2" npx -y arpk serve
```

#### docker

```bash
docker run -d \
  --name arpk \
  --network host \
  --restart unless-stopped \
  -e ARPK_LLM_MODEL=llama3.2 \
  ghcr.io/moeru-ai/arpk:latest
```

#### docker-compose

```yaml
services:
  arpk:
    image: ghcr.io/moeru-ai/arpk:latest
    container_name: arpk
    network_mode: host
    restart: unless-stopped
    environment:
      - ARPK_LLM_MODEL=llama3.2
```

#### API

`/translate`, `/api/v1/translate` and `/api/v2/translate` are connected to the same translate endpoint.

```ts
await fetch('http://127.0.0.1:1188/translate', {
  body: JSON.stringify({
    source_lang: 'JA',
    target_lang: 'ZH',
    text: '雨の季節が過ぎ 澄み渡る空を 眺めて独り想フ'
  }),
  method: 'POST'
}).then(res => res.json())
// {
//   alternates: [],
//   code: 200,
//   data: '雨季过后，晴朗的天空下我独自遐思。',
//   id: 1519129853500,
//   method: 'ARPK v0.0.0 (llama3.2)',
//   source_lang: 'JA',
//   target_lang: 'ZH'
// }
```

### Environments

> Currently only Bearer Auth is supported when using `ARPK_TOKEN`, not URL Params.

<!-- https://www.tablesgenerator.com/markdown_tables -->

| Environment | Default | Description |
|---|---|---|
| ARPK_PORT | 1188 | The port the server will listen on |
| ARPK_TOKEN | null | Access token to protect your API |
| ARPK_LLM_API_KEY | null | OpenAI-compatible API key |
| ARPK_LLM_BASE_URL | http://127.0.0.1:11434/v1/ | OpenAI-compatible API base url |
| ARPK_LLM_MODEL | llama3.2 | Model to be used by the ARPK |
| ARPK_LLM_SEED | null | Seed to be used by the ARPK |
| ARPK_SYSTEM_PROMPT | https://github.com/moeru-ai/arpk/blob/main/src/lib/prompts.ts | System prompt |
| ARPK_SOURCE_LANG | null | Translate source language (cli only, `--from`) |
| ARPK_TARGET_LANG | null | Translate target language (cli only, `--to`) |

## License

[MIT](LICENSE.md)

---
_Source: https://npm.io/package/arpk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
