Skip to content

Add Thinking Machines (Tinker) model provider support - #109

Open
devin-ai-integration[bot] wants to merge 1 commit into
developfrom
devin/1784217297-thinking-machines-model
Open

devin-ai-integration[bot] wants to merge 1 commit into
developfrom
devin/1784217297-thinking-machines-model

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Adds Thinking Machines' Tinker as a selectable inference provider, wired through the same "bring your own key" path as Fireworks/OpenAI/Anthropic. Users add their key + model checkpoint under Settings ▸ Keys and pick Thinking Machines in the model picker (iOS list + Mac menu, both data-driven so no picker-specific code was needed).

The Tinker OpenAI-compatible API differs from the other hosted providers in one important way: there is no fixed model list — the "model" is a user-specific sampler checkpoint path (tinker://…/sampler_weights/…). So we store two values instead of one: THINKY_API_KEY and THINKY_MODEL_PATH, and the model's apiModelID resolves from the stored path at request time.

Endpoint (from the Tinker OpenAI-compatible docs):
https://tinker.thinkingmachines.dev/services/tinker-prod/oai/api/v1/chat/completions, Bearer auth, OpenAI-compatible wire format (so TinkerChat reuses OpenAIChat.wireMessages exactly like FireworksChat).

Changes

  • KeyStore: new Key.thinky (THINKY_API_KEY) + Key.thinkyModelPath (THINKY_MODEL_PATH), new Service.thinky ("Thinking Machines") surfacing both keys in its editor; model path is treated as non-secret in maskedPreview.
  • ModelSelection: new ModelProvider.thinky and ModelSelection.tinker.
    case .tinker:
        provider           .thinky
        apiModelID         KeyStore.shared.value(for: .thinkyModelPath)  // user-supplied
        contextWindowSize  nil        // varies per checkpoint
        requiredKey        .thinky
        supportsVision     false      // text turns only
  • TinkerChat (new): streaming client mirroring FireworksChat; errors visibly when the key or model path is missing rather than silently falling back.
  • AgentHarness: routes .thinkyTinkerChat.
  • ModelPickerVC: footer copy for the Thinking Machines section.
  • Exhaustive-switch updates so the new enum cases compile everywhere: ConversationTitleService (adds a Tinker title path, only used when Tinker is the selected provider and both values are set), VisionSummaryService (grouped with .apple → OCR fallback, since Tinker is text-only), VMAgentRuntime (.thinky falls through — the Loop VM runner can't target Tinker's custom base URL), and IntegrationSkill key-alias map.
  • ContextUsageTests: .tinker joins .appleFoundation as a model with an intentionally-nil context window.
  • Secrets.xcconfig.example: documents the two new build-time vars.

Onboarding was intentionally left out of scope — its simple single-key paste-chip flow doesn't fit Tinker's key + checkpoint-path requirement; Tinker is added via Settings ▸ Keys instead.

Testing

Not build-verified: this is a Swift/Xcode iOS+macOS app and the working environment has no macOS toolchain (swiftc/xcodebuild unavailable). Verified instead by auditing that every exhaustive switch over ModelProvider/ModelSelection now handles the new cases.

Link to Devin session: https://app.devin.ai/sessions/a2cdd7f461b1428ebbd7d589308818d5
Requested by: @theashbhat

Co-Authored-By: Ash Bhat <ash.bhat@getathelas.com>
@theashbhat theashbhat self-assigned this Jul 16, 2026
@theashbhat
theashbhat self-requested a review July 16, 2026 15:59
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author
Original prompt from Ash Bhat

can you help me add support for thinking machine's new model

the secret for this will be THINKY_API_KEY
lets add support for this in settings and enable users to select this in model picker for iOS and Mac

here's the documentation
https://tinker-docs.thinkingmachines.ai/tinker/compatible-apis/openai/ @getathelas/LoopHarness

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loop-harness Ready Ready Preview, Comment Jul 16, 2026 3:59pm

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