Giter Club home page Giter Club logo

arpk's Introduction

ARPK npm

Ollama as your translator, with DeepLX-compatible API.

Usage

Prepare

You need to run Ollama and download the model you want to use.

https://ollama.com/

ollama serve
ollama pull llama3.1

Run

npm

You can run ARPK directly without installation.

ARPK_MODEL="llama3.1" npx arpk

container

TODO

API

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

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',
//   source_lang: 'JA',
//   target_lang: 'ZH'
// }

Environments

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

Environment Default Description
ARPK_PORT 1188 The port the server will listen on
ARPK_MODEL llama3.1 Model to be used by the ARPK
ARPK_TOKEN null Access token to protect your API
ARPK_OLLAMA_HOST http://127.0.0.1:11434 The Ollama host address
ARPK_SYSTEM_PROMPT https://github.com/moeru-ai/arpk/blob/main/src/lib/prompts.ts System prompt

License

MIT

arpk's People

Contributors

kwaa avatar

Stargazers

Kytrun avatar  avatar seya avatar Sevi avatar  avatar  avatar Pink Champagne avatar Access avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.