{"id":47700552,"url":"https://github.com/tom-ryder/agentrunkit","last_synced_at":"2026-04-05T20:01:44.962Z","repository":{"id":339072402,"uuid":"1136097182","full_name":"Tom-Ryder/AgentRunKit","owner":"Tom-Ryder","description":"Lightweight Swift 6 framework for building LLM-powered agents — cloud + on-device inference via MLX on Apple Silicon","archived":false,"fork":false,"pushed_at":"2026-04-02T17:40:53.000Z","size":1426,"stargazers_count":15,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-03T03:34:09.888Z","etag":null,"topics":["agent-framework","ai-agents","anthropic","apple-silicon","function-calling","generative-ai","ios","llm","local-llm","macos","mcp","mlx","model-context-protocol","multimodal","ollama","on-device-ai","openai","openrouter","swift","tool-calling"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tom-Ryder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-17T04:02:53.000Z","updated_at":"2026-04-03T03:04:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Tom-Ryder/AgentRunKit","commit_stats":null,"previous_names":["tom-ryder/agentrunkit"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/Tom-Ryder/AgentRunKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tom-Ryder%2FAgentRunKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tom-Ryder%2FAgentRunKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tom-Ryder%2FAgentRunKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tom-Ryder%2FAgentRunKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tom-Ryder","download_url":"https://codeload.github.com/Tom-Ryder/AgentRunKit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tom-Ryder%2FAgentRunKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31448216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T15:22:31.103Z","status":"ssl_error","status_checked_at":"2026-04-05T15:22:00.205Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-framework","ai-agents","anthropic","apple-silicon","function-calling","generative-ai","ios","llm","local-llm","macos","mcp","mlx","model-context-protocol","multimodal","ollama","on-device-ai","openai","openrouter","swift","tool-calling"],"created_at":"2026-04-02T17:07:48.443Z","updated_at":"2026-04-05T20:01:44.957Z","avatar_url":"https://github.com/Tom-Ryder.png","language":"Swift","readme":"# AgentRunKit\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/logo-dark.png\" alt=\"AgentRunKit\" width=\"280\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Tom-Ryder/AgentRunKit/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/Tom-Ryder/AgentRunKit/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Swift-6.0-orange\" alt=\"Swift 6.0\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Platforms-iOS%2018%20%7C%20macOS%2015-blue\" alt=\"Platforms\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/On--Device-MLX%20%7C%20Foundation%20Models-8B5CF6\" alt=\"On-Device MLX + Foundation Models\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/SPM-compatible-brightgreen\" alt=\"SPM\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-lightgrey\" alt=\"License\"\u003e\n  \u003ca href=\"https://swiftpackageindex.com/Tom-Ryder/AgentRunKit/documentation/agentrunkit\"\u003e\u003cimg src=\"https://img.shields.io/badge/Documentation-DocC-blue\" alt=\"Documentation\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  A lightweight Swift 6 framework for building LLM-powered agents with type-safe tool calling.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eZero dependencies\u003c/b\u003e · \u003cb\u003eFull Sendable\u003c/b\u003e · \u003cb\u003eAsync/await\u003c/b\u003e · \u003cb\u003eCloud + Local\u003c/b\u003e · \u003cb\u003eMCP\u003c/b\u003e\n\u003c/p\u003e\n\n---\n\n## Quick Start\n\n```swift\nimport AgentRunKit\n\nlet client = OpenAIClient(apiKey: \"sk-...\", model: \"gpt-5.4\", baseURL: OpenAIClient.openAIBaseURL)\n\nlet weatherTool = try Tool\u003cWeatherParams, String, EmptyContext\u003e(\n    name: \"get_weather\",\n    description: \"Get the current weather\"\n) { params, _ in\n    \"72°F and sunny in \\(params.city)\"\n}\n\nlet agent = Agent(client: client, tools: [weatherTool])\nlet result = try await agent.run(userMessage: \"What's the weather in SF?\", context: EmptyContext())\nif let content = result.content {\n    print(content)\n}\n```\n\n`result.content` is optional. Completed runs return finish-tool content, while structural terminal reasons such as max iterations or token budget exhaustion surface through `result.finishReason` with no final content.\n\n---\n\n## Documentation\n\nFull documentation including guides and API reference is available on [Swift Package Index](https://swiftpackageindex.com/Tom-Ryder/AgentRunKit/documentation/agentrunkit).\n\n---\n\n## Installation\n\nAdd to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/Tom-Ryder/AgentRunKit.git\", from: \"1.20.1\")\n]\n```\n\n```swift\n.target(name: \"YourApp\", dependencies: [\"AgentRunKit\"])\n```\n\nFor on-device inference, additional targets are available:\n\n- `AgentRunKitMLX` for MLX on Apple Silicon (requires [mlx-swift-lm](https://github.com/ml-explore/mlx-swift-lm) as a dependency)\n- `AgentRunKitFoundationModels` for Apple Foundation Models (iOS 26+ / macOS 26+, no external dependencies)\n\n---\n\n## Features\n\n- Agent loop with configurable iteration limits and token budgets\n- Streaming with `AsyncThrowingStream` and `@Observable` SwiftUI wrapper\n- Type-safe tools with compile-time JSON schema validation\n- Sub-agent composition with depth control and streaming propagation\n- Context management: automatic compaction, pruning, token budgets\n- Structured output with JSON schema constraints\n- Multimodal input: images, audio, video, PDF\n- Text-to-speech with concurrent chunking and MP3 concatenation\n- MCP client: stdio transport, tool discovery, JSON-RPC\n- Extended thinking / reasoning model support\n\n---\n\n## Providers\n\n| Provider | Description |\n|----------|-------------|\n| `OpenAIClient` | OpenAI and compatible APIs (OpenRouter, Groq, Together, Ollama) |\n| `AnthropicClient` | Anthropic Messages API |\n| `GeminiClient` | Google Gemini API |\n| `VertexAnthropicClient` | Anthropic models on Google Vertex AI |\n| `VertexGoogleClient` | Google models on Vertex AI |\n| `ResponsesAPIClient` | OpenAI Responses API with same-substrate continuity replay |\n| `FoundationModelsClient` | Apple on-device (macOS 26+ / iOS 26+) |\n| `MLXClient` | On-device via MLX on Apple Silicon |\n\n---\n\n## Requirements\n\n| Platform | Version |\n|----------|---------|\n| iOS | 18.0+ |\n| macOS | 15.0+ |\n| Swift | 6.0+ |\n| Xcode | 16+ |\n\n---\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-ryder%2Fagentrunkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom-ryder%2Fagentrunkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-ryder%2Fagentrunkit/lists"}