[BREAKGLASS] One interface, every AI model. A Swift SDK to interface with AI providers. http://tachikoma.build
Go to file
Peter Steinberger a6c5cb90b1
Some checks failed
Lint / SwiftLint (push) Has been cancelled
CI / Desktop Swift (${{ matrix.os }}) (macos-15) (push) Has been cancelled
CI / Desktop Swift (${{ matrix.os }}) (ubuntu-22.04) (push) Has been cancelled
CI / Build Examples on ${{ matrix.os }} (macos-15) (push) Has been cancelled
CI / SwiftLint (push) Has been cancelled
Cross-Platform CI / test-macos-14 (push) Has been cancelled
Cross-Platform CI / test-macos-15 (push) Has been cancelled
Cross-Platform CI / Ubuntu 22.04 LTS (push) Has been cancelled
Cross-Platform CI / Ubuntu 24.04 LTS (push) Has been cancelled
Lint / SwiftFormat (push) Has been cancelled
Lint / Swift 6 Compatibility Check (push) Has been cancelled
Lint / Package Validation (push) Has been cancelled
Tests / Test Apple Platforms (platform=macOS, macOS, macosx) (push) Has been cancelled
Tests / Test Linux (6.2.1) (push) Has been cancelled
Tests / Validate Swift Package (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
CI / Apple Platforms (${{ matrix.platform }}) (iOS Simulator) (push) Has been cancelled
Cross-Platform CI / build-release (push) Has been cancelled
fix(models): complete GPT-5 Chat registration
2026-06-13 02:41:53 -04:00
.github/workflows feat: add Claude Fable 5 support (#21) 2026-06-11 13:05:47 -07:00
assets Complete Tachikoma Swift Package with logo header 2025-08-02 22:49:53 +02:00
docs feat: add Claude Fable 5 support (#21) 2026-06-11 13:05:47 -07:00
Examples fix(models): block unsupported Grok multi-agent routing 2026-06-08 23:33:04 +01:00
scripts chore: add core coverage helper 2025-11-13 03:08:44 +00:00
Sources fix(models): complete GPT-5 Chat registration 2026-06-13 02:41:53 -04:00
Tests fix(models): complete GPT-5 Chat registration 2026-06-13 02:41:53 -04:00
.gitignore Remove .DS_Store files and update .gitignore 2025-08-03 14:46:44 +02:00
.swiftformat chore: sync updates 2025-11-18 10:46:42 +01:00
.swiftlint.yml feat: add Claude Fable 5 support (#21) 2026-06-11 13:05:47 -07:00
AGENTS.md docs: note grouped git ops 2026-03-13 18:38:14 +00:00
CHANGELOG.md fix(models): complete GPT-5 Chat registration 2026-06-13 02:41:53 -04:00
CLAUDE.md Rename CLAUDE.md to AGENTS.md 2025-11-07 02:55:40 +00:00
CONTRIBUTING.md docs(readme): simplify and move advanced content 2025-12-18 08:48:29 +01:00
LICENSE build: update swift dependencies and fix license 2026-04-27 11:29:07 +01:00
Package.resolved fix(build): refresh package resolution 2026-06-08 23:59:29 +01:00
Package.swift fix(build): prefer sibling Commander checkout 2026-06-08 23:59:21 +01:00
README.md feat: add Claude Fable 5 support (#21) 2026-06-11 13:05:47 -07:00
test-grok-stream-tools.swift style: run swiftformat 2026-03-13 20:19:11 +00:00
test-grok-tachikoma.swift style: run swiftformat 2026-03-13 20:19:11 +00:00
test-grok-tools.swift refactor: normalize model parsing and reformat sources 2025-11-05 12:24:37 +00:00
test-grok.swift refactor: normalize model parsing and reformat sources 2025-11-05 12:24:37 +00:00
test-output.log Align providers with GPT-5/o4 model lineup 2025-11-06 21:03:23 +00:00

Tachikoma Logo

Tachikoma — Swift AI SDK

Swift 6.0+ Platforms MIT License CI Status

Tachikoma banner

Modern, Swift-native APIs for text, vision, tools, and realtime voice.

Install

Swift Package Manager:

.package(url: "https://github.com/steipete/Tachikoma.git", branch: "main"),
.product(name: "Tachikoma", package: "Tachikoma"),

Quick Start

import Tachikoma

let text = try await generate("Write a haiku about Swift.", using: .anthropic(.opus45))
print(text)

Streaming

import Tachikoma

let stream = try await stream("Explain actors in Swift.", using: .openai(.gpt54))
for try await delta in stream {
    print(delta.content ?? "", terminator: "")
}

Conversation

import Tachikoma

let conversation = Conversation()
conversation.addUserMessage("You are a concise assistant.")
conversation.addUserMessage("Summarize Swift concurrency in 3 bullets.")
let reply = try await conversation.continue(using: .anthropic(.opus45))
print(reply)

Vision

import Tachikoma

let pngData: Data = /* ... */
let image = ImageInput(data: pngData, mimeType: "image/png")
let answer = try await analyze(image: image, prompt: "Whats in this image?", using: .openai(.gpt55))
print(answer)

Tools (function calling)

import Tachikoma

let tool = createTool(
    name: "add",
    description: "Add two integers",
    parameters: [
        .init(name: "a", type: .integer, description: "First"),
        .init(name: "b", type: .integer, description: "Second"),
    ]
) { args in
    let a = try args.intValue("a")
    let b = try args.intValue("b")
    return ["sum": a + b]
}

let result = try await generateText(
    model: .openai(.gpt54),
    messages: [.user("Compute 123 + 456 using the add tool.")],
    tools: [tool],
    maxSteps: 3
)
print(result.text)

Models

Common picks:

  • Anthropic: claude-opus-4-8 (LanguageModel.default, non-streaming), claude-fable-5 (explicit opt-in)
  • OpenAI: gpt-5.5 (LanguageModel.defaultStreaming), gpt-5.4 / gpt-5.4-mini / gpt-5.4-nano, gpt-5
  • Google: gemini-3.1-pro-preview, gemini-3-flash
  • Grok: grok-4.3
  • Local: ollama/llama3.3

Full catalog (including enum case names + provider notes): docs/models.md.

Credentials

Set API keys via env vars (or use TKAuthManager):

  • OpenAI: OPENAI_API_KEY
  • Anthropic: ANTHROPIC_API_KEY
  • Gemini: GEMINI_API_KEY (alias: GOOGLE_API_KEY)
  • Grok: X_AI_API_KEY (aliases: XAI_API_KEY, GROK_API_KEY)

Hosts can change the credential storage root:

  • TachikomaConfiguration.profileDirectoryName (Peekaboo uses .peekaboo)

Documentation

License

MIT. See LICENSE.