Skip to content

feat(ai-providers): add Runcrate as an AI provider - #4171

Closed
heydryft wants to merge 1 commit into
TableProApp:mainfrom
heydryft:feat/runcrate-provider
Closed

heydryft wants to merge 1 commit into
TableProApp:mainfrom
heydryft:feat/runcrate-provider

Conversation

@heydryft

@heydryft heydryft commented Nov 9, 2026

Copy link
Copy Markdown

Thanks for keeping vendor presets to one struct literal and a test: since AIProviderPreset landed 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/v1 that 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 .custom provider carrying the preset id runcrate, so a build that has never heard of the preset still decodes it as a working custom provider and no new AIProviderType case is added.

Changes

  • apple/TablePro/Models/AI/AIProviderPreset.swift: new runcrate preset (id, display name, Base URL https://api.runcrate.ai/v1, cloud SF Symbol, key required) and it is appended to AIProviderPreset.all, which is what the Add Provider menu iterates. rejectsBadKeyWithForbidden is false: 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: a runcratePreset test next to requestyPreset. It checks the key requirement, the 401 mapping flag, that a provider added from the preset is a custom provider with the runcrate preset id, and that the default Base URL resolves to https://api.runcrate.ai/v1/chat/completions and https://api.runcrate.ai/v1/models. The existing presetsAreWellFormed test already covers every entry in all, 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/models once 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: Bearer header, to the Base URL they added.

How I tested

  • Standalone compile check: I compiled AIProviderPreset.swift and AIEndpoint.swift from this branch with swiftc, with small stand-ins for AIProviderType.AuthStyle and TableProUtilities.LoopbackHost, plus a throwaway main.swift repeating the assertions of the new test. It printed https://api.runcrate.ai/v1/chat/completions and https://api.runcrate.ai/v1/models, and the unique id, https and endpoint-resolution checks held for every entry in all. The scratch files are not part of this PR.
  • One live request to POST https://api.runcrate.ai/v1/chat/completions (model deepseek-ai/DeepSeek-V4.1-Flash, max_tokens 16) returned HTTP 200 with a chat completion. This was a plain curl to the URL the preset resolves to, not a run through the app. A request with a deliberately invalid key returned HTTP 401.
  • I did not run the Xcode unit test plan (verify.sh test AIProviderPresetTests), xcodebuild, swiftlint or the UI tests: the full build needs XcodeGen and the Rust toolchain, which I did not have set up. So the new test in AIProviderPresetTests.swift has not been run under Swift Testing here, and I am relying on CI for that.
  • Not included: a changelog.d/<PR>.added.md fragment, 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.

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.
@datlechin

Copy link
Copy Markdown
Member

Hi @heydryft, thanks for the contribution! Unfortunately we don't accept new OpenAI-compatible providers anymore.

@datlechin datlechin closed this Nov 11, 2026
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.

2 participants