symfony/ai-deep-seek-platform
DeepSeek platform bridge for Symfony AI, enabling chat completions, function calling, and multi-round conversations through the DeepSeek API. Integrates DeepSeek models into Symfony AI applications.
Architecture fit
DeltaInterface chunks. Streaming deltas matter because they map cleanly onto broadcast events (Laravel Echo/Reverb) for live chat UX — but that mapping is ours to build.symfony/ai monorepo, its changelog entries are PRs reviewed by Symfony core contributors (@fabpot, @chr-hertel), and it is released in lockstep with sibling bridges. It is low-adoption in the Laravel world, not orphaned. That distinction should be stated explicitly to anyone reading the score.Integration feasibility
symfony/http-client and related components can collide with existing pins. Mitigate by isolating the bridge behind an internal interface in our own code rather than calling it from controllers/jobs directly — that keeps a future rip-and-replace to one adapter class.ModelNotFoundException, IncompleteStreamException, ExceedContextSizeException, and a retryable ServerException for transient 5xx. That maps directly onto queue retry policy and user-facing fallback messaging without us reverse-engineering HTTP codes. This is a meaningful reduction in support burden.TokenUsage::model property, no signature changes. The only exposure is anywhere we serialize or persist TokenUsage — the shape changed, so strict hydration will break. Trivial to mitigate, easy to forget.Technical risk
~0.14.0, not ^0.14, and treat minor bumps as reviewable changes rather than routine dependency maintenance. Budget a recurring upgrade-review line item.TokenUsage::model plus prompt/completion counts lets us compute spend, but there is no pricing table in the package. We own the rate card, its currency handling, its versioning as DeepSeek changes prices, and reconciliation against the DeepSeek invoice. Small, permanent, and easy to under-scope.Key questions
TokenUsage populated on every path, including function-calling round trips and aborted streams? Partial coverage means under-reported spend.Stack fit
AiClient-style interface. Controllers, jobs, and listeners never touch Symfony AI types directly.config/ai.php (provider, key, model IDs, timeouts, retry policy), all sourced from environment and secrets management — never committed.Migration path
TokenUsage into a usage table with the model dimension, plus a rate card and a daily spend report. Do this before scaling traffic, not after.Compatibility
~0.14.0. Add a Composer constraint note and a boot-time model-ID assertion. Review every minor bump as a change request, not a composer update.TokenUsage is persisted as JSON, either tolerate unknown keys or version the stored shape before upgrading. Decide this before Phase 3, not during it.symfony/* pins exist in the current lockfile. If they do, resolve at the container level rather than patching the bridge.Sequencing
Spike → adapter → single bounded feature → usage/cost observability → streaming → multi-provider routing. The ordering is deliberate: observability ships before scale, and the adapter ships before anything else, because it is the only thing that makes the rest reversible.
Maintenance
Support
ExceedContextSizeException, ModelNotFoundException, IncompleteStreamException, and retryable ServerException let support triage without reading stack traces.Scaling
Failure modes
ServerException plus an aggressive queue retry policy can amplify an upstream incident. Mitigation: capped retries with backoff and a circuit breaker.TokenUsage schema that gained a property. Mitigation: tolerant deserialization.Ramp-up
How can I help you explore Laravel packages today?