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?

PLaMo 3.0 Prime を Hermes Agent から使うときのハマりどころ

0
Posted at

PLaMo 3.0 Primeがリリースされました!
このモデルはAPI形式で利用できるため、Hermesの裏側にセットするのも比較的簡単にできています!

が、実際には設定ファイルの問題で若干ハマりどころがあったのでメモしておきます。

最終的な設定ファイル

以下のように設定すると正常に動作しました。

model:
  provider: "custom:plamo"
  default: "plamo-3.0-prime"
  # providers の下に書いても効かない
  max_tokens: 20000
providers:
  plamo:
    base_url: "https://api.platform.preferredai.jp/v1"
    key_env: "PLAMO_API_KEY"
    models:
      plamo-3.0-prime:
        # 256k 対応だが、claude/gptもフルに使わない方が精度が安定するという話もあるので控えめに
        # context_length: 262144
        context_length: 65536

原因

Hermes のデフォルト設定では max_tokens が 65535 になっているようです。

一方で、PLaMo 3.0 Prime の出力トークン上限は 20,000 トークンです。

そのため、明示的に max_tokens: 20000 を設定する必要があります。
ただ、この max_tokens ですが、context_length と同じところに書いても効かないので、現状だと model の下に書く必要があります。
(変な挙動なのでバグかも?)

動作確認

設定後は以下のように正常に応答するようになります。

────────────────────────────────────────
● こんにちは
Initializing agent...

────────────────────────────────────────

╭─ ⚕ Hermes ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    こんにちは!ご挨拶ありがとうございます。今日はどのようなお手伝いをいたしましょうか?
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
 ⚕ plamo-3.0-prime │ 648/65.5K │ [░░░░░░░░░░] 1% │ 8s │ ⏲ 2s │ ✓ 1s

(この記事は個人の記事です。所属組織・団体とは一切関係ありません)

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?