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?

Jevのwaitlistが待てないのでVercel AI Gateway経由で今すぐ試す

0
Last updated at Posted at 2026-09-20

はじめに

今話題のJevを試そうとしたのですが、2日前にwaitlistに入ってからまだ招待メールがきません。
Vercel の AI Gateway を利用することで今すぐに試す事が可能のようなので、試してみようと思います。

Jevとは

Jevとは判断に特化したAIモデルです。
判断に特化させることでLLMよりも高速で安価に利用することが可能のようで、現在話題となっています。

今すぐJevを試す方法

現状はwaitlistに入り利用できるまで待つことになりますが、VercelのAI Gatewayであれば今すぐ実行を試す事ができました。

指定するモデルは以下です。

試してみる

まずはAPIキーを発行し、AI_GATEWAY_API_KEYという値でexportします。

 export AI_GATEWAY_API_KEY="APIキー"

続いてSDKのインストールです。

npm install ai

そして、リクエスト用のjsonファイルと、送信用のjsファイルを作成しました。
modelでtypesafe-ai/jevと指定する事でjevを利用できるようです。

index.json
{
  "model": "typesafe-ai/jev",
  "state": {
    "message": "私はマヨネーズが大好きです。これからサラダを食べます。"
  },
  "questions": {
    "topping_choice": {
      "type": "choice",
      "instructions": "オススメするのはどれ?",
      "criteria": {
        "mayonnaise": "マヨネーズ",
        "dressing": "ドレッシング",
        "salt": "塩",
        "none": "何もかけない"
      }
    },
    "health_risk_level": {
      "type": "score",
      "instructions": "マヨネーズ使うことによる健康への影響",
      "criteria": ["全く問題なし", "問題なし", "どちらとも言えない", "問題あり", "すごい問題あり"]
    },
    "is_mayo_ok": {
      "type": "boolean",
      "instructions": "マヨネーズかけていい?"
    }
  }
}

index.js
import { experimental_evaluate as evaluate } from 'ai'
import request from './index.json' with { type: 'json' }

const result = await evaluate(request)
console.log(JSON.stringify(result.answers, null, 2))

実行してみると、ちゃんとレスポンスが返ってきました。
レスポンスもあっという間に返ってきます。
timeで実行時間を測っているためnodeの起動なども含んでいますが、それでも速いですね。

実行
$ time node index.js
{
  "topping_choice": {
    "type": "choice",
    "choice": "mayonnaise",
    "probabilities": {
      "dressing": 0.12,
      "none": 0,
      "salt": 0,
      "mayonnaise": 0.88
    }
  },
  "health_risk_level": {
    "type": "score",
    "score": 1.85,
    "probabilities": {
      "0": 0.08,
      "1": 0.14,
      "2": 0.65,
      "3": 0.13,
      "4": 0
    }
  },
  "is_mayo_ok": {
    "type": "boolean",
    "probability": 0.74
  }
}
node index.js  0.17s user 0.04s system 32% cpu 0.656 total

3種類の質問

現状、jevは以下の3種類の質問(question)タイプを処理できるようです。

  • choice:選択肢の中から選ぶ
  • score:点数をつける
  • noul(Vercelだとboolean):yes/no の質問に対して確率で答える

リクエストでは、stateに背景情報を記載し、questionsに先の3つの質問を記載して送信します。

(再掲)リクエストパラメータ
{
  "model": "typesafe-ai/jev",
  "state": {
    "message": "私はマヨネーズが大好きです。これからサラダを食べます。"
  },
  "questions": {
    "topping_choice": {
      "type": "choice",
      "instructions": "オススメするのはどれ?",
      "criteria": {
        "mayonnaise": "マヨネーズ",
        "dressing": "ドレッシング",
        "salt": "塩",
        "none": "何もかけない"
      }
    },
    "health_risk_level": {
      "type": "score",
      "instructions": "マヨネーズ使うことによる健康への影響",
      "criteria": ["全く問題なし", "問題なし", "どちらとも言えない", "問題あり", "すごい問題あり"]
    },
    "is_mayo_ok": {
      "type": "boolean",
      "instructions": "マヨネーズかけていい?"
    }
  }
}

それに対するレスポンスがこちらです。
各質問に対し、確率付き(probabilities)で回答がなされています。

{
  "topping_choice": {
    "type": "choice",
    "choice": "mayonnaise",
    "probabilities": {
      "dressing": 0.12,
      "none": 0,
      "salt": 0,
      "mayonnaise": 0.88
    }
  },
  "health_risk_level": {
    "type": "score",
    "score": 1.85,
    "probabilities": {
      "0": 0.08,
      "1": 0.14,
      "2": 0.65,
      "3": 0.13,
      "4": 0
    }
  },
  "is_mayo_ok": {
    "type": "boolean",
    "probability": 0.74
  }
}

stateで背景を伝える

先ほどはマヨネーズをオススメされましたが、コレステロールの値が上がってきたという条件を追加してみましょう。

{
  "model": "typesafe-ai/jev",
  "state": {
    "message": "私はマヨネーズが大好きです。しかし最近LDLコレステロールの数値が上がってきました。これからサラダを食べます。"
  },
  "questions": {
    〜省略〜
  }
}

すると、マヨネーズは食べないほうが良いという回答になりました。

$ time node index.js
{
  "topping_choice": {
    "type": "choice",
    "choice": "none",
    "probabilities": {
      "salt": 0,
      "none": 0.63,
      "dressing": 0.36,
      "mayonnaise": 0.01
    }
  },
  "health_risk_level": {
    "type": "score",
    "score": 2.97,
    "probabilities": {
      "0": 0,
      "1": 0.01,
      "2": 0.05,
      "3": 0.89,
      "4": 0.05
    }
  },
  "is_mayo_ok": {
    "type": "boolean",
    "probability": 0.32
  }
}
node index.js  0.17s user 0.04s system 33% cpu 0.637 total

おわりに

今回はJevを試してみました。
これだけ話題になっている中waitlistに入るのが遅れてしまいいつ使えるようになるかなぁと思っていたのですが、Vercelで試す事ができよかったです。
使い方についてもこれからどんどん開拓されていきそうな予感なので、直近は追っておこうと思います。

ここまでご覧いただきありがとうございました!

参考

JevについてやVercel AI SDK で試す事が可能なことはこちらの記事で知りました。
ありがとうございます!

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?