# How You Change The AI Provider With 1 Line Of Code

> With the contract in the right place, switching providers is fast, easy to test, and leaves other modules untouched.

- URL: https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/04-clean-architecture-integration/lesson-04-swap-ai-provider-with-one-line
- Course: [Mobile Action Pro](https://dantech.academy/en/courses/kotlin-accelerator.md)
- Module: Clean Architecture and Integration
- Duration: 12 min
- Difficulty: intermediate
- Access: Enrolled students
- Tiếng Việt: https://dantech.academy/courses/kotlin-accelerator/engineer-builder/04-clean-architecture-integration/lesson-04-swap-ai-provider-with-one-line.md

## Objectives

- Set up the right contract for the AI Provider feature
- Switch the AI provider with one DI line and see how easy it is
- Explain why the iOS build always uses LocalHintProvider without a platform if branch

## In this lesson

1. Lesson Goal
2. Part 1: The Path Of One AI Assistant Tap
3. Part 2: Two Contracts For One Task, Why?
4. Part 3: 1 Line Of Code Changes Everything
5. Part 4: Same Code, iOS Always Uses Local
6. Exercise: Add A Third Provider
7. Code Reading Path
8. Bad Smells
9. Key Takeaways

## Study with an AI agent

The full lesson is for students of this course. Students open the lesson on the web and press **Markdown** to copy all of it, then paste it into Claude, ChatGPT, Cursor or whichever agent you use. Faster: mint a token at `/profile/ai-agents` and your agent reads lessons over MCP.

- [Join the course](https://dantech.academy/en/kotlin-accelerator/checkout)

---

- Previous lesson: [The Clean Architecture Of A Sign-In Tap](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/04-clean-architecture-integration/lesson-03-trace-supabase-auth-flow.md)
- Next lesson: [Composition Root: Where Providers Are Defined](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/04-clean-architecture-integration/lesson-05-wire-dependencies-at-composition-root.md)
