Hermes Agent で DeepSeek を使う。
DeepSeek V4 は RunAPI を通じて OpenAI チャット補完と Anthropic messages の両プロトコルに対応します。Hermes Agent は custom:runapi プロバイダー経由で接続します——他のモデルに使用するのと同じベース URL とキーを使用します。リクエストパラメータで推論モードを有効化します。RunAPI は DeepSeek を公式料金の 50% で価格設定します。
RunAPI を使って Hermes Agent の custom:runapi プロバイダー経由で DeepSeek V4 Pro を呼び出します。
要件:
- Hermes Agent ですでに設定されている custom:runapi プロバイダーを使用します
- RunAPI のチャット補完エンドポイント https://runapi.ai/v1/chat/completions を呼び出します
- model を "deepseek-v4-pro" に設定します
- RUNAPI_API_KEY 環境変数が認証を提供します
- レスポンスは OpenAI チャット補完形式の SSE イベントとしてストリーミングされます
- 推論を有効にするには、リクエストボディで thinking.type を "enabled" に設定します
curl -X POST https://runapi.ai/v1/chat/completions \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a Python function that finds the longest palindromic substring in O(n) time using Manacher algorithm."}
],
"stream": true,
"max_tokens": 4096
}'
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "deepseek-v4-pro",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is Manacher's algorithm implementation..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 356,
"total_tokens": 398
}
}
Hermes Agent で DeepSeek を使う3ステップ
Configure RunAPI provider
Set the RUNAPI_API_KEY environment variable. If you already added RunAPI as custom:runapi in Hermes Agent, the same provider and key work for DeepSeek — no extra configuration. If not, add RunAPI with base_url https://runapi.ai/v1 and api_mode chat_completions.
export RUNAPI_API_KEY=runapi_xxx
Select a DeepSeek model
Switch the model to deepseek-v4-pro for quality or deepseek-v4-flash for speed. Both use the /v1/chat/completions endpoint through the custom:runapi provider. Enable reasoning by passing thinking.type set to enabled — no separate model entry needed.
model: deepseek-v4-pro
Stream the response
Hermes Agent receives the response as an SSE stream in OpenAI chat completions format. Token usage appears in the final event. Switch between DeepSeek, GPT, and Claude models without changing the provider config — only the model field changes.
stream: true
DeepSeek チャット補完パラメータ
| パラメータ | 型 | 説明 |
|---|---|---|
model |
string |
Required. deepseek-v4-pro or deepseek-v4-flash. |
messages |
array |
Required. Array of message objects with role (system, user, assistant) and content fields. |
stream |
boolean |
Optional. Set to true for SSE streaming. Default false. |
max_tokens |
integer |
Optional. Maximum number of tokens to generate. |
temperature |
number |
Optional. Sampling temperature between 0 and 2. Lower values are more deterministic. |
thinking |
object |
Optional. Set type to "enabled" to activate DeepSeek's built-in reasoning mode. |
Hermes AgentのDeepSeekとは?
DeepSeek V4はバジェットフレンドリーなLLMで、RunAPIではOpenAIとAnthropicの両プロトコルサーフェスで動作します。Hermes AgentはGPTやClaudeと同じcustom:runapi provider経由で呼び出します——modelパラメーターを変えるだけです。RunAPIはDeepSeekのすでに低い価格の50%で提供し、単一のAPIキーで利用できる最低コストの推論能力モデルになります。
DeepSeekの活用例
セルフホスティング代替の評価
オープンソースウェイトをセルフホストするかどうかを決める前に、RunAPIのAPIでDeepSeekをテストします。APIコストがインフラの損益分岐点を下回れば、ホステッドバージョンを使い続けます。
思考連鎖を表示する推論UIの構築
Thinkingモードを有効にして思考トークンをUIに表示し、モデルがどのように問題を解いたかユーザーに見せます。チュータリングアプリ・コードデバッグツール・意思決定サポートシステムに適しています。
最低コストの大量バッチ処理
大量ドキュメントセット・分類タスク・データ抽出ジョブに対してDeepSeek Flashで高速低コスト処理を行い、1トークンあたりコストがピーク品質より重要なシナリオに最適です。
DeepSeek + Hermes Agent のよくある質問
Yes. If you already have custom:runapi configured in Hermes Agent, switch the model to deepseek-v4-pro or deepseek-v4-flash. The base URL, API key, and api_mode stay the same. Use hermes model or edit the config file directly.
When you enable reasoning (thinking.type set to enabled), DeepSeek generates additional "thinking" tokens that show its chain-of-thought process. These tokens count as output tokens and are billed accordingly. They improve accuracy on complex tasks but increase total token usage.
Self-hosting requires significant GPU infrastructure (80GB+ VRAM for the full model). Through RunAPI at 50% of DeepSeek's already low rates, most teams save money on the API until they hit very high sustained volume. Start with the API and evaluate self-hosting once your monthly token spend justifies the hardware cost.
Pass thinking.type set to enabled in the request body. Reasoning mode is a request parameter, not a separate model. The reasoning tokens are billed as output tokens. This works through both the OpenAI and Anthropic protocol surfaces.
RunAPI prices DeepSeek tokens at 50% of official DeepSeek rates. Since DeepSeek already undercuts GPT and Claude on per-token cost, this makes it the lowest-priced reasoning-capable LLM available through a single API. No subscription, no minimum — pay per token.
Configure the provider type in Hermes Agent. Use the OpenAI-compatible provider for chat completions format, or the Anthropic-compatible provider for messages format. Both route through RunAPI to the same DeepSeek models.
Yes. Set the model parameter in each request to the desired variant. Hermes Agent can route quick tasks to Flash and complex reasoning to Reasoner, all through the same custom:runapi provider and API key.
今すぐ Hermes Agent で DeepSeek を試す。
無料の RunAPI キーを取得し、Hermes Agent で model を deepseek-v4-pro に設定して、DeepSeek に直接アクセスする半分のコストで推論を始めましょう。