Repository navigation
Conversation
Adds a Runcrate preset to Add Provider, an OpenAI-compatible AI cloud with its Base URL filled in. Stored as a custom provider with a preset id, like Requesty.
Member
|
Hi @heydryft, thanks for the contribution! Unfortunately we don't accept new OpenAI-compatible providers anymore. |
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.
Thanks for keeping vendor presets to one struct literal and a test: since
AIProviderPresetlanded with Requesty, adding another OpenAI-compatible vendor is a few lines.Summary
Adds Runcrate to Add Provider…. Runcrate is an AI cloud with an OpenAI-compatible chat completions API at
https://api.runcrate.ai/v1that serves open models. It goes through the existing OpenAI-compatible transport, the same way the Requesty preset does, so no new request path is involved.As with Requesty, the provider is stored as a
.customprovider carrying the preset idruncrate, so a build that has never heard of the preset still decodes it as a working custom provider and no newAIProviderTypecase is added.Changes
apple/TablePro/Models/AI/AIProviderPreset.swift: newruncratepreset (id, display name, Base URLhttps://api.runcrate.ai/v1,cloudSF Symbol, key required) and it is appended toAIProviderPreset.all, which is what the Add Provider menu iterates.rejectsBadKeyWithForbiddenisfalse: a wrong key gets a 401 from Runcrate (checked with a throwaway key), so the default authentication-failure mapping applies.apple/TableProTests/Core/AI/AIProviderPresetTests.swift: aruncratePresettest next torequestyPreset. It checks the key requirement, the 401 mapping flag, that a provider added from the preset is a custom provider with theruncratepreset id, and that the default Base URL resolves tohttps://api.runcrate.ai/v1/chat/completionsandhttps://api.runcrate.ai/v1/models. The existingpresetsAreWellFormedtest already covers every entry inall, so it picks up the new preset without a change.Defaults
Opt-in only. Nothing is selected by default and no existing provider, preset or setting changes. Users who do not pick Runcrate in Add Provider see no difference. The model list is fetched from the provider's own
GET /v1/modelsonce a key is entered, as for the other OpenAI-compatible providers.What is sent to Runcrate
Only what the user chooses to send through the AI assistant to that provider, with their API key in the
Authorization: Bearerheader, to the Base URL they added.How I tested
AIProviderPreset.swiftandAIEndpoint.swiftfrom this branch withswiftc, with small stand-ins forAIProviderType.AuthStyleandTableProUtilities.LoopbackHost, plus a throwawaymain.swiftrepeating the assertions of the new test. It printedhttps://api.runcrate.ai/v1/chat/completionsandhttps://api.runcrate.ai/v1/models, and the unique id, https and endpoint-resolution checks held for every entry inall. The scratch files are not part of this PR.POST https://api.runcrate.ai/v1/chat/completions(modeldeepseek-ai/DeepSeek-V4.1-Flash,max_tokens16) returned HTTP 200 with a chat completion. This was a plaincurlto the URL the preset resolves to, not a run through the app. A request with a deliberately invalid key returned HTTP 401.verify.sh test AIProviderPresetTests),xcodebuild,swiftlintor the UI tests: the full build needs XcodeGen and the Rust toolchain, which I did not have set up. So the new test inAIProviderPresetTests.swifthas not been run under Swift Testing here, and I am relying on CI for that.changelog.d/<PR>.added.mdfragment, because the file name needs the PR number, and the paired draft PR in TableProApp/docs. I am happy to add the fragment once the number exists, or for you to add the one-line entry.Disclosure: I work on Runcrate.
This PR was prepared with AI assistance (omp with Claude): the code, tests and this description were written with it, and the commands above were run as part of preparing it.