Skip to content

Add SiliconFlow as a built-in provider - #39

Closed
Rex-Gao wants to merge 1 commit into
jkudish:mainfrom
Rex-Gao:siliconflow-provider
Closed

Rex-Gao wants to merge 1 commit into
jkudish:mainfrom
Rex-Gao:siliconflow-provider

Conversation

@Rex-Gao

@Rex-Gao Rex-Gao commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

What

Adds SiliconFlow (硅基流动) as a sixth provider alongside TypeSafe, OpenRouter, Cloudflare, Vercel, and the generic compatible endpoint:

  • SILICONFLOW_API_KEY auto-selects SiliconFlow when it is the only configured provider credential, outranking the compatible fallback; JEV_PROVIDER=siliconflow forces it.
  • The transport POSTs the standard { model, state, questions } contract to https://api.siliconflow.cn/v1/systemone and reuses the local fetch-based resilience path: the 408/409/429/5xx retry allowlist, the 1 MB streamed byte ceiling, the whole-request deadline, and fixed-string client-visible errors.
  • The default jev-latest maps to SiliconFlow's current alias semif, mirroring the OpenRouter jev-1.13 mapping. Unknown model names are sent verbatim for the endpoint to reject — no silent rewriting, per the "configuration errors, never silent fallbacks" rule.
  • The API root is overridable via JEV_SILICONFLOW_BASE_URL, following the existing JEV_OPENROUTER_BASE_URL / JEV_CLOUDFLARE_BASE_URL convention (this is also what makes the transport testable against a local mock).

Why

SiliconFlow is a practical carrier for callers who cannot reach TypeSafe or OpenRouter reliably. The endpoint speaks the same System One contract the compatible adapter already targets, so this is a small, self-contained transport with no new dependencies.

Testing

  • npm run typecheck, npm run build, and npm test pass: 246 tests, including 7 new ones covering the wire request shape and auth header, the jev-latest → semif alias mapping, auto-selection (alone and in preference over a complete compatible credential pair), non-2xx statuses surfacing as fixed-string errors without upstream body text, malformed 200 bodies, and the missing-key configuration error.

Notes for review

  • Auto-detection order: the dedicated provider key outranks the generic compatible fallback when both are configured (TypeSafe/OpenRouter/Cloudflare/Vercel credentials still win over both, exactly as before).
  • The branch is based on current main (0.10.1) and follows the fixed-string error convention from 0.10.0 — no upstream response text reaches MCP-visible errors.

SiliconFlow serves the System One contract at
https://api.siliconflow.cn/v1/systemone, giving callers a carrier where
TypeSafe and OpenRouter are hard to reach. The transport follows the
local fetch-based pattern (retry allowlist, byte ceiling, whole-request
deadline, fixed-string client-visible errors) and auto-selects when
SILICONFLOW_API_KEY is the only configured credential, outranking the
compatible fallback; force it with JEV_PROVIDER=siliconflow. The
default jev-latest maps to the SiliconFlow alias semif; unknown model
names go to the wire verbatim for the endpoint to reject. The API root
is overridable via JEV_SILICONFLOW_BASE_URL, mirroring the OpenRouter
and Cloudflare overrides.

jkudish commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Thank you for submitting this. The transport is well built and the tests are thorough.

Provider and transport support now live in @jkudish/jev-agent-tools, the shared transport layer for Jev, so new carriers are added there rather than in jev-mcp. The adding a provider guide covers the options, including publishing yours as a third-party driver package.

If you publish one, a PR linking it from the READMEs is welcome.

@Rex-Gao

Rex-Gao commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the pointer! The transport now lives where it belongs: jkudish/jev-agent-tools#4 adds SiliconFlow as a built-in driver there, following the add-a-provider guide (driver shape, fixed-string errors, jev-latest → semif mapping, hermetic tests).

Happy to close this in favor of that PR — and if you'd like, the README link from jev-mcp's provider section can land separately once it's released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants