Lee-Si-Yoon/deepseek-harness-friendli ↗★ 0
deepseek-harness-friendli
适用于 DeepSeek Harness 的 FriendliAI 无服务器大模型适配器。
AI 分析
核心用途是接入 FriendliAI 的无服务器推理服务。适合需要使用 Friendli 兼容 API 进行流式对话、动态模型发现和推理任务的 DSH 用户。
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗deepseek-harness-friendli
A DeepSeek Harness LLM adapter for FriendliAI serverless inference. Friendli speaks the OpenAI-compatible chat-completions API, so this plugin implements the harness LlmAdapter contract over it and pulls its model catalog from Friendli at runtime.
What you get
- Streaming chat completions against
https://api.friendli.ai/serverless/v1, translated into the harnessStreamChunkprotocol (text, reasoning, and tool-call blocks). - Dynamic model discovery — the catalog comes from
GET /modelsat runtime; nothing is hand-maintained. Deprecated entries are dropped. - Reasoning support for controllable models via
parse_reasoning+include_reasoning, with an on/off thinking toggle mapped to Friendli'schat_template_kwargs.enable_thinking. - Stable error codes — HTTP and transport failures become
LlmErrorwith codes (AUTH,RATE_LIMIT,MODEL_NOT_FOUND, …); model-list failures are distinct from inference failures. AbortSignalforwarding and mandatoryattributionHeaders()on every request, per the harness adapter contract.
Install
Until this is published to npm, install from GitHub:
pnpm add github:Lee-Si-Yoon/deepseek-harness-friendli
Peer dependencies (provided by your harness composition): @deepseek-ai/dsh-llm, @deepseek-ai/cordis, @deepseek-ai/schemastery.
Authenticate
The token is read from the environment at each request — never inline it in a config file or commit it.
export FRIENDLI_TOKEN="flp_..."
Get a token from the Friendli dashboard.
Configure
Add the adapter to your cordis.yml and point an agent at a Friendli model id. See examples/cordis.yml for a complete fragment.
- id: deepseek-harness-friendli
name: 'deepseek-harness-friendli'
config:
apiKeyEnv: FRIENDLI_TOKEN # default
baseURL: https://api.friendli.ai/serverless/v1 # default
providers: [friendli] # default
thinking: enabled # optional; on/off for controllable models
| Config field | Default | Meaning |
|---|---|---|
apiKeyEnv | FRIENDLI_TOKEN | Environment variable holding the bearer token |
baseURL | serverless endpoint | Endpoint base; /chat/completions and /models are appended |
providers | [friendli] | Provider route(s) this adapter serves |
thinking | model default | enabled / disabled for controllable-reasoning models; ignored by always-reasoning models |
modelCacheTtlMs | 60000 | How long the fetched model catalog is cached |
Use a model
Reference a model by the exact id returned by GET /models:
- id: agent-loop
name: '@deepseek-ai/dsh-agent-loop'
config:
agents:
- id: main
provider: friendli
model: zai-org/GLM-5.2
Dynamic model discovery
Available models are fetched from Friendli Serverless at runtime, so the list reflects the current catalog rather than a snapshot baked into this package. The set of models — and whether a given request is accepted — depends on the account, region, permissions, and model lifecycle. A model appearing in the public /models response does not guarantee every request for it will succeed; permission and lifecycle checks still apply at inference time and surface as an LlmError.
Reasoning
Friendli parses reasoning model-agnostically. This adapter always requests parse_reasoning: true + include_reasoning: true, so reasoning tokens arrive on delta.reasoning_content and become harness reasoning blocks.
Models fall into two kinds (Friendli docs):
- Always-reasoning (e.g.
MiniMaxAI/MiniMax-M2.5) — reason regardless;thinkingconfig has no effect. - Controllable (e.g.
zai-org/GLM-5.2) —thinking: enabled|disabledmaps tochat_template_kwargs.enable_thinking. The adapter advertises an on/off reasoning toggle only for models whose/modelsentry declares atogglecapability. Discrete effort levels are not exposed, because the serverless reasoning API is documented only for the on/offenable_thinkingswitch — offering effort levels would promise choices the wire cannot honor.
Troubleshooting
| Symptom | Meaning |
|---|---|
MISSING_CREDENTIAL | FRIENDLI_TOKEN (or your apiKeyEnv) is unset or blank |
AUTH (401) | Invalid or expired token |
FORBIDDEN (403) | Account lacks access to the model |
MODEL_NOT_FOUND (404) | Model id unavailable or deprecated |
RATE_LIMIT (429) | Friendli rate limit reached |
SERVER (5xx) | Temporary provider-side failure |
MODEL_LIST_FAILED | Runtime GET /models discovery failed (distinct from an inference failure) |
Develop
pnpm install
pnpm run lint:all # typecheck + tests in one pass
pnpm run build
Publish to the community plugin store
There is no official DeepSeek plugin hub. The community DSH Plugin Store crawls every GitHub repo tagged with the dsh-plugin topic hourly — no PR or review. This repo carries that topic, so once it is public it is picked up automatically. The store performs no vetting; review any third-party plugin before installing.
License
MIT © Lee-Si-Yoon