Skip to content

feat(providers): add LLMTR as an OpenAI-compatible gateway - #2156

Open
knowhycodata wants to merge 1 commit into
HKUDS:devfrom
knowhycodata:add-llmtr-provider-dev
Open

knowhycodata wants to merge 1 commit into
HKUDS:devfrom
knowhycodata:add-llmtr-provider-dev

Conversation

@knowhycodata

Copy link
Copy Markdown

Description

Adds LLMTR (https://llmtr.com) as a built-in OpenAI-compatible gateway provider, following the same pattern as Onomeo and Runcrate. Disclosure: I maintain LLMTR.

  • deeptutor/services/provider_registry.py: new llmtr ProviderSpec (openai_compat, gateway, LLMTR_API_KEY, key prefix llmtr-, base keyword llmtr, default base https://llmtr.com/v1). Model ids are not stripped, so prefixed ids like llmtr/qwen3-8-27b work as-is.
  • web/lib/provider-branding.ts + web/public/provider-icons/llmtr.png: icon for the Settings provider picker, with its source recorded in sources.json.
  • Tests: provider choices, runtime resolution for the llmtr binding, base-URL detection from an openai binding, and inclusion in the native-tools provider list.

Related Issues

Module(s) Affected

  • agents
  • api
  • config
  • core
  • knowledge
  • logging
  • services
  • tools
  • utils
  • web (Frontend)
  • docs (Documentation)
  • scripts
  • tests
  • Other: ...

Checklist

  • This PR targets dev (not main).
  • I have read and followed the contribution guidelines.
  • My code follows the project's coding standards.
  • I have run pre-commit run --all-files and fixed any issues. (Ran ruff check and ruff format --check on the changed files instead; both clean.)
  • I have added relevant tests for my changes.
  • I have updated the documentation (if necessary). (No docs change needed; the provider shows up in Settings.)
  • My changes do not introduce any new security vulnerabilities.

Additional Notes

Tested from a fresh clone of this branch (Python 3.13, requirements/full.txt, editable install):

  • pytest tests/api/test_settings_router.py tests/core/test_agentic_client_provider_kwargs.py tests/services/config/test_provider_runtime.py: 176 passed.
  • Live check with a real key: deeptutor init --non-interactive, then deeptutor config apply with {"llm": {"provider": "llmtr", "model": "llmtr/qwen3-8-27b", "api_key_env": "LLMTR_API_KEY"}} (validated with --check first), then deeptutor run chat "Reply with exactly: LLMTR_OK" --format json. The chat streamed back LLMTR_OK and completed in one round, about 2.4 s.
  • For Qwen model ids the existing heuristic sends extra_body={"enable_thinking": true}; LLMTR accepts it, so no special handling is needed.

This branch has not been deployed

No deployments
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.

1 participant