DEV Community

Mohammad Hammad Ahmad
Mohammad Hammad Ahmad

Posted on

Flutter_Deepseek Package !

*I wanted DeepSeek streaming in Flutter to feel like Flutter.
*

Not:

final response = await deepseek.createChatCompletion(
   ChatCompletionRequest(
    model: 'deepseek-chat',
    messages: [/* your messages */],
    stream: true,
   ),
  );
  // Handle stream using Dio's response stream...
Enter fullscreen mode Exit fullscreen mode

But this:

 await for (final token in client.chatStream(
   messages: [ChatMessage.user('Explain Flutter')],
  )) {
   setState(() => response += token);
  }

Enter fullscreen mode Exit fullscreen mode

Each token reaches your widget the moment DeepSeek generates it.
No waiting for the full response. No manual SSE parsing. Just a Dart Stream that works naturally with Flutter.

So I built flutter_deepseek — the only Flutter DeepSeek package with true Stream, reasoner support, and function calling, all in one.

Features:
→ Real-time SSE streaming with Stream
→ deepseek-reasoner support
→ Reasoning stream and final answer available separately
→ Function calling / tool use
→ Typed exceptions: AuthException · RateLimitException · BadRequestException · ServerException · NetworkException
→ Zero Dio dependency (built on dart:http)
→ Fully injectable http.Client for testing
→ 160 pub points on day one

I built and shipped DeepSeek-powered features in production before writing this package.

That experience shaped the API far more than the documentation did.

Open source. MIT licensed. Actively maintained.

👉 https://lnkd.in/dTHDxKYH

Top comments (0)