0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Unsloth デスクトップアプリでLayaのJev API互換のローカルサーバーを立てる

0
Posted at

概要

ローカルでのJev互換について調査。
以下の要件を満たしたい

  • 他言語対応
  • CPU動作可能
  • 一度モデルをロードすれば、ロードし直さずAPIで何度も実行可能

Unsloth デスクトップアプリならJev API互換のローカルサーバーを立てることが簡単。

セットアップ

基本は上記の通り進める。
①Unsloth をセットアップ ではUnsloth デスクトップアプリをダウンロードする。
②Laya をセットアップ・③判断リクエストを送る とは設定の名称など少し差異があるので、自分がした時のスクショで解説する。

Laya をセットアップ

Settings → API → 判定API(Decision API) を開き、 リクエストに応答をオン。

image.png

デフォルトの Laya モデル(678 MB)のダウンロードが開始
image.png

ダウンロード後はこうなる
image.png

ローカルから呼び出すときAPIキー不要にする場合はChat and inferenceをオン
image.png

判断リクエストを送る

コマンドプロンプトで実行する場合は、以下のcmdで呼ぶ。(APIキー不要版)

curl http://localhost:8888/v1/systemone ^
-H "Content-Type: application/json" ^
-d "{\"model\":\"laya\",\"state\":\"3月分の請求書(#4411)で二重請求されました。本日中に重複分を返金してください。\",\"questions\":{\"team\":{\"type\":\"choice\",\"instructions\":\"この案件はどのチームが担当すべきですか?\",\"criteria\":{\"billing\":\"請求書、支払い、返金\",\"technical\":\"バグ、停止、エラー\",\"sales\":\"価格、新しいプラン\",\"other\":\"それ以外すべて\"}},\"refund\":{\"type\":\"noul\",\"instructions\":\"顧客は返金を求めていますか?\"},\"urgency\":{\"type\":\"score\",\"instructions\":\"どれくらい緊急ですか?\",\"criteria\":[\"緊急ではない\",\"近日中\",\"本日\"]}}}"

実行結果は以下
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?