Repository navigation
WIP: feat: add OpenLLM provider - #2008
Draft
apewithllm wants to merge 1 commit into
Draft
apewithllm wants to merge 1 commit into
apewithllm wants to merge 1 commit into
Conversation
Contributor
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords: 2
Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
REPLACE: what this PR is, in 1 to 2 sentences max.Author Review (required)
Architecture Review (select 1)
NAReview Requested from Code Reviewer (select 1)
[reason - required if selected]Agentic Code Review (must check all before requesting CR)
/spec deep cron this PR or used/specCRs throughoutWhat to Review
REPLACE: 1-4 decisions you made.REPLACE: List of paths/files to review. example libs/code/adapters/KevAdapter.pyUI Review (select all that apply)
personContributor License Agreement
I, @, confirm that I have read and agree to the Contributors License Agreement.
Agentic PR Summary
TLDR: Kiln users want to run evals and synthetic data on the models and subscriptions that they already have, so this PR adds OpenLLM as a native provider. Targets
main. No companion PRs.OpenLLM routes the API keys, OAuth subscription accounts, and local models of a user through one endpoint. Before this PR, a user connects OpenLLM only as a custom OpenAI compatible provider. The user must type the base URL and add each model by hand. After this PR, the Connect Providers screen shows an OpenLLM card. Kiln lists the chat models of the user from the OpenLLM gateway.
OpenLLM also supports the full
/v1/API surface and has an MCP server. See the OpenLLM documentation.Implementation
openllmvalue is added toModelProviderName. The display name is "OpenLLM". The structure follows the Cloudflare Workers AI provider (feat: add Cloudflare Workers AI as a model provider #1824).openllm_base_url(envOPENLLM_BASE_URL) andopenllm_api_key(envOPENLLM_API_KEY, sensitive). The default base URL is the local daemon,http://127.0.0.1:8787/v1. The API key is optional. A user can set the hosted endpointhttps://www.openllm.sh/v1and ansk-llm-key.openairoute with the base URL. When the user sets no key, Kiln sends the placeholderopenllm, because LiteLLM needs a key. The local daemon treats that bearer as the saved login.connect_openllmsends an async request to{base_url}/models. It saves the settings only on success. The error messages tell the user to runopenllm start, to install OpenLLM, to runopenllm login(loopback only), or that the API key is not valid./api/available_modelsincludes the OpenLLM models. Kiln keeps only the models whosecapabilitiescontainchat. Kiln keeps the model IDs as the gateway gives them, for exampleclaude_code/claude-opus-4-8orlite. Thetools,vision, andjson_modecapabilities set the function calling, vision, and structured output flags. All OpenLLM models are untested models, the same as Ollama models.api_schema.d.tsis regenerated withgenerate_schema.sh.Warning
conventionsreportscore-config-sharedat the two newConfig.shared()reads inlite_llm_core_config_for_provider. All other providers in that function use the same pattern. This PR does not add them to the allowlist.Checks
uv run ./checks.sh --agent-modeexits 0 on the committed branch.misspellis not installed on this machine, so that step was skipped.ruff check,ruff format --check, andty checkpass (3 warnings ing_eval.pyandeval.pyare also onmain).npm run lint,format_check,check(0 errors), andconnect_providers.test.ts(20 passed) pass. An earlier fulltest_runpassed 3753 tests andnpm run buildpassed.liteworks throughLiteLlmAdapter.get_weather {"city":"Paris"}./spec deep crran. A separate agent review ran, and its findings are fixed: the auth error messages, a comment, a reverted rename, and fewer duplicate tests.Docs and skills updated: none. No doc in the repo lists providers. The
docs-syncskill did not run.