Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Deep Seek Api Bundle Laravel Package

tourze/deep-seek-api-bundle

A Symfony bundle that integrates the DeepSeek API into your application, providing ready-made service configuration and dependency injection so you can call DeepSeek chat and completion models with minimal setup.

View on GitHub
Deep Wiki
Context7

Getting Started

  • This is the initial 0.0.1 release of tourze/deep-seek-api-bundle; there is no prior assessment and the release notes only link to the changelog. Treat it as experimental until the public API, configuration, and Laravel compatibility are verified.
  • Install with a pinned constraint while evaluating:
    composer require tourze/deep-seek-api-bundle:0.0.1
    
  • Look first at README.md, composer.json, src/, DependencyInjection/, and Resources/config/. The -bundle suffix and Tourze package conventions suggest Symfony-style DI/configuration, so confirm whether a Laravel service provider is included before assuming Laravel auto-discovery.
  • Configure the DeepSeek API key through .env and Laravel config, not directly in code:
    DEEPSEEK_API_KEY=sk-...
    DEEPSEEK_BASE_URL=https://api.deepseek.com
    
  • First use case: a non-streaming chat completion using deepseek-chat, wrapped behind your own application service so the package is not referenced directly from controllers:
    final class DeepSeekChatService
    {
        public function complete(array $messages, array $options = []): string
        {
            // Resolve/configure the package client here, then call its chat completion API.
        }
    }
    
  • Before building features, make one smoke-test request in a queued job or Artisan command, log the request shape and response status, and confirm exception behavior for invalid keys, timeouts, and rate limits.

Implementation Patterns

  • Bridge Symfony bundle services into Laravel. If the package does not ship Laravel auto-discovery, create a small application service provider that binds the package client/interface as a singleton and maps package configuration into Laravel config/services.php.
  • Wrap the package in a domain service. Keep package-specific classes, DTOs, and exceptions inside one adapter such as App\Services\DeepSeek\DeepSeekClient. This limits upgrade pain while the package is at 0.0.x.
  • Inject the adapter, not the vendor client. Controllers, jobs, and commands should depend on your adapter or interface. That makes it easy to replace the package later or mock it in tests.
  • Use queued jobs for non-trivial prompts. DeepSeek calls can be slow. Dispatch chat/completion work to a queue with explicit timeouts and retries instead of blocking HTTP requests.
  • Keep model and option defaults in config. Store default model, temperature, max tokens, and timeout in config/deepseek.php or config/services.php, with environment overrides for local/staging/production.
  • Normalize errors at the adapter boundary. Convert package/HTTP exceptions into application-level exceptions such as DeepSeekUnavailableException, DeepSeekRateLimitException, and DeepSeekValidationException.
  • Stream only where the UI needs it. If the package exposes streaming, keep streaming behind a dedicated endpoint or job; for most CRUD/admin workflows, non-streaming completions are simpler to test and log.
  • Test with the package’s HTTP layer. If it uses Symfony HttpClient, Laravel’s Http::fake() may not intercept it. Mock the package client or Symfony HTTP client instead, and assert request payloads and error handling.

Gotchas and Tips

  • 0.0.1 is not a stability promise. Pin the exact version, review the changelog before every upgrade, and avoid exposing vendor classes across your codebase.
  • Symfony bundle vs. Laravel package. Do not assume composer require is enough. Check for a Laravel service provider; if absent, register services manually and translate Symfony-style configuration into Laravel config.
  • Release notes are thin. The only release note is a changelog link, so verify supported models, streaming support, timeout configuration, retry behavior, and exception types directly from source before relying on them.
  • Watch Composer conflicts. Tourze bundles may pull Symfony components that overlap with Laravel’s installed versions. If installation fails, inspect with composer why-not tourze/deep-seek-api-bundle 0.0.1.
  • Set timeouts and retries explicitly. DeepSeek API calls can be slow or rate-limited. Configure connect/read timeouts, retry on 429 and 5xx with backoff, and avoid retrying validation/auth failures.
  • Protect prompts and responses in logs. Do not log full messages, API keys, or user data by default. Redact secrets and sensitive content; log request IDs, model, token counts, latency, and status where available.
  • Clear Laravel caches after config changes. Run php artisan config:clear when changing API keys, base URLs, or model defaults, especially in local/staging environments.
  • Prefer decoration over vendor edits. If you need custom headers, base URI, middleware, or logging, decorate/wrap the package client rather than editing vendor/.
  • Be Octane-safe. Keep the client stateless and avoid mutable per-request state in singletons.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment