llm_dart 0.7.1 copy "llm_dart: ^0.7.1" to clipboard
llm_dart: ^0.7.1 copied to clipboard

A modular Dart library for AI provider interactions with unified interface for OpenAI, Anthropic, Google, DeepSeek, Ollama, xAI, Groq, ElevenLabs and more.

example/README.md

LLM Dart Examples #

Practical examples for the LLM Dart library, organized by learning path and use case.

Quick Start #

I need to... Go to
Get started quickly quick_start.dart
Build a chatbot chatbot.dart
Compare providers provider_comparison.dart
Use streaming streaming_chat.dart
Call functions tool_calling.dart
Handle audio audio_processing.dart
Generate images image_generation.dart
Process large datasets batch_processor.dart
Build multimodal apps multimodal_app.dart
Connect external tools mcp_concept_demo.dart

Directory Structure #

Getting Started #

First-time users

  • quick_start.dart - Basic usage
  • provider_comparison.dart - Compare providers
  • basic_configuration.dart - Configuration
  • environment_setup.dart - Environment setup

Core Features #

Essential functionality

  • capability_factory_methods.dart - Type-safe provider initialization
  • chat_basics.dart - Basic chat
  • streaming_chat.dart - Real-time streaming
  • tool_calling.dart - Function calling
  • enhanced_tool_calling.dart - Advanced tool usage
  • structured_output.dart - JSON output
  • assistants.dart - AI assistants
  • embeddings.dart - Text embeddings
  • audio_processing.dart - Speech/TTS
  • image_generation.dart - Image generation
  • file_management.dart - File operations
  • web_search.dart - Web search integration
  • content_moderation.dart - Content filtering
  • model_listing.dart - Available models
  • capability_detection.dart - Feature detection
  • error_handling.dart - Error handling

Advanced Features #

Specialized capabilities

  • reasoning_models.dart - AI thinking processes
  • multi_modal.dart - Images/audio processing
  • batch_processing.dart - Concurrent processing
  • realtime_audio.dart - Real-time audio
  • semantic_search.dart - Vector search
  • custom_providers.dart - Custom providers
  • performance_optimization.dart - Optimization

Provider Examples #

Provider-specific features

Provider Features Directory
OpenAI GPT, DALL-E, assistants openai/
Anthropic Claude, thinking anthropic/
DeepSeek Reasoning, cost-effective deepseek/
Groq Fast inference groq/
Ollama Local models ollama/
ElevenLabs Voice synthesis elevenlabs/
xAI Live search, Grok xai/
Others OpenAI-compatible others/

Use Cases #

Complete applications

  • chatbot.dart - Interactive chatbot with personality
  • cli_tool.dart - Command-line AI assistant
  • web_service.dart - HTTP API with authentication
  • flutter_integration.dart - Flutter app patterns
  • batch_processor.dart - Large-scale data processing
  • multimodal_app.dart - Text, image, and audio processing

MCP Integration #

External tool connections

  • mcp_concept_demo.dart - Core concepts
  • simple_mcp_demo.dart - Basic integration
  • basic_mcp_client.dart - MCP client
  • custom_mcp_server.dart - Custom server
  • mcp_tool_bridge.dart - Tool bridging
  • mcp_with_llm.dart - LLM integration
  • test_all_examples.dart - Test runner

Setup #

Set API keys for the providers you want to use:

export OPENAI_API_KEY="your-key"
export ANTHROPIC_API_KEY="your-key"
export GROQ_API_KEY="your-key"
export DEEPSEEK_API_KEY="your-key"

Run examples:

dart run 01_getting_started/quick_start.dart
dart run 02_core_features/chat_basics.dart
dart run 05_use_cases/chatbot.dart
dart run 05_use_cases/batch_processor.dart --help
dart run 05_use_cases/multimodal_app.dart --demo

Learning Path #

Beginner: Start with quick_start.dartprovider_comparison.dartchat_basics.dart

Intermediate: Focus on tool_calling.dartstructured_output.dartchatbot.dart

Advanced: Study batch_processor.dartmultimodal_app.dartcustom_providers.dart

Production: Explore performance_optimization.dart → provider-specific features → MCP integration

Production Example #

Yumcha - A production Flutter app built with LLM Dart, showcasing real-world integration patterns and best practices.

Resources #

8
likes
0
points
626
downloads

Publisher

unverified uploader

Weekly Downloads

A modular Dart library for AI provider interactions with unified interface for OpenAI, Anthropic, Google, DeepSeek, Ollama, xAI, Groq, ElevenLabs and more.

Repository (GitHub)
View/report issues

Topics

#ai #llms #nlp

License

unknown (license)

Dependencies

dio, http_parser, logging

More

Packages that depend on llm_dart