BYOKにOllama(ローカル)を足す (B18) - #96
Merged
Merged
Conversation
AIProvider.ollama を追加(キー不要、既定 http://localhost:11434)。ATS の NSAllowsLocalNetworking を Info.plist に足して loopback への平文 http を許可し、 AIConfig.baseURL も loopback 相手なら http の上書きを通すようにした。 AIClient のキー必須ガードは provider.requiresAPIKey で分岐。リクエスト/レスポンス/ SSE は OpenAI 互換の /v1/chat/completions をそのまま流用する。 実機の Ollama(llama3.2:1b)で送信・ストリーミング両方を確認済み。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
AIProvider.ollamaを追加(キー不要、既定http://localhost:11434)NSAllowsLocalNetworkingを追加してloopbackへの平文httpを許可AIConfig.baseURLをloopback相手ならhttp上書きも通すよう緩和AIClientのキー必須ガードをprovider.requiresAPIKeyで分岐.openAIのロジックを流用(OllamaはOpenAI互換)Test plan
swift test(新規6件含め全緑)ollama pull llama3.2:1bで送信・ストリーミング両方確認testが通ることを確認🤖 Generated with Claude Code