@steve31415/llm-failover
v1.9.0
Published
LLM API client with automatic provider failover (Anthropic, Gemini, OpenAI)
Readme
@steve31415/llm-failover
LLM API client with automatic provider failover (Anthropic, Gemini, OpenAI).
Structured output (jsonSchema)
Callers author one portable JSON schema; each provider adapter translates it into that provider's native dialect, so you never write provider-specific schemas:
- Anthropic — forced
tool_use; schema passed through asinput_schema. - Gemini —
responseSchema, withadditionalPropertiesrecursively stripped (Gemini rejects it). - OpenAI —
response_format: json_schemawithstrict: true, and the schema normalized into OpenAI's strict dialect: every object getsadditionalProperties: falseand lists all its properties inrequired(OpenAI strict mode requires both). A property that was optional in the source schema is emulated as a nullable union (type: ["T", "null"], plusnulladded to anyenum) so the model can still emitnullto mean "absent". Without this normalization OpenAI 400s on any schema with optional fields, silently killing it as a failover target.
Publishing
Published via npm Trusted Publishing. Push a v* tag to trigger the GitHub Actions workflow, which builds, tests, and publishes automatically.
# 1. Bump version in package.json
# 2. Commit the version bump
# 3. Tag and push:
git tag v<version>
git push && git push origin v<version>Plasticine Way: ec0578a (2026-06-21)
