Clawith icon indicating copy to clipboard operation
Clawith copied to clipboard

Add Tsubasa to the existing LLM provider registry

Open cenab opened this issue 2 months ago • 0 comments

Add Tsubasa to the existing LLM provider registry

Pre-checks

  • [x] I have searched existing issues and this is not a duplicate.

The search covered Tsubasa issues and pull requests in this repository. Existing provider-registry and context-window work is reused by this proposal.

What problem does this solve?

The existing Custom provider can already serialize Tsubasa chat requests, but users must enter its endpoint and public model aliases manually. A named registry entry would expose the same setup through the existing provider options API and admin model UI.

Proposed solution

Add a tsubasa entry to PROVIDER_REGISTRY in backend/app/services/llm/client.py, using protocol="openai_compatible" and default base URL https://api.tsubasa.sh/v1. Reuse OpenAICompatibleClient; no separate transport or frontend hard-coded provider list is needed.

The two public aliases are tsubasa-fast and tsubasa-pro. Their combined input/output context limit is 32,768 tokens. Setup guidance should explicitly set the existing model context-window field to 32,768 and use a bounded output override such as 4,096. Keep parallel-tool support disabled and avoid claiming other optional capabilities without their own verification.

Proposed tests cover registry options/default URL, explicit URL override, persisted model context/output settings, both aliases over JSON and SSE, and 401 propagation. The final admin-to-agent path must show that the saved 32K setting reaches prompt admission. Run the repository's required backend lint/tests before a linked PR.

The current native factory was exercised at commit 45fc701c366c69f89dff26d91d6a4a9cbc38e6f8: eight controlled requests passed across both aliases, normal and streaming replies, and rejected keys. Every serialized request passed Tsubasa's actual schema and admission-budget helper. These checks used synthetic credentials and a loopback fixture; they do not qualify live inference, the database/admin UI path, or an entire agent workflow.

The existing manual Custom provider remains a valid alternative. The merged provider registry refactor #77 establishes the extension point; pending third-party provider requests are not evidence of acceptance. This issue precedes implementation because CONTRIBUTING.md requires every PR to link an issue.

Willing to contribute?

  • [x] I'd be interested in working on this.

Maintainer scope approval is pending.

cenab avatar Sep 28 '26 03:09 cenab