Skip to content

Community integration: a Symfony bundle for Jev #9

Description

@vbcherepanov

Community integration: a Symfony bundle for Jev

Sharing a community integration in case it is useful to list, along the lines of the "Community" request in typesafe-sdk-js#7. It is unofficial and not affiliated with TypeSafe.

vbcherepanov/jev-symfony-bundle (Apache-2.0, PHP 8.4+, Symfony 7.4 / 8.x, on Packagist):

composer require vbcherepanov/jev-symfony-bundle
  • A typed client for POST /v1/systemone and GET /v1/models on Symfony HttpClient. Retries match the official SDKs: 408/429/5xx with retry-after-ms / Retry-After up to 60 s, and X-TypeSafe-Retry-Count on retries.
  • Validator constraints, e.g. #[JevNoul('Is this spam?', max: 0.2)] on a form field, and #[JevChoice] with a minimum confidence.
  • Messenger fan-out, Workflow guards decided by a noul/choice answer, a web-profiler panel (questions, probabilities, confidence, tokens, request ids), and jev:models / jev:ask console commands.
  • A fake client for application tests. The Flex recipe (Add recipe for vbcherepanov/jev-symfony-bundle symfony/recipes-contrib#2064) turns it on under when@test.

It handles the API details I ran into while building it, several of which I reported here:

Covered by 205 tests and PHPStan at max level; CI runs PHP 8.4/8.5 × Symfony 7.4/8.0. A live smoke test against the API runs locally when TYPESAFE_API_KEY is set.

Activity

  1. aoright commented on Sep 24, 2026

    @aoright

    This is an exceptionally well-engineered community integration.

    Highlights of the Implementation

    1. Symfony Architectural Fit:
      Embedding Jev decisions into Symfony Workflow guards and validator attributes (#[JevNoul], #[JevChoice]) is a natural application pattern for sub-second System One inference. It allows developers to guard state machine transitions with typed AI verdicts without leaving the standard framework lifecycle.
    2. Robust Edge-Case Handling:
      Proactively addressing wire contract nuances—such as handling numeric choice keys, normalizing 401/403 authentication error payloads, parsing release_date timestamps, and pre-validating the 10-level score upper bound—makes this client unusually resilient.
    3. Developer Experience:
      The inclusion of WebProfiler panels and a deterministic test double for Symfony Flex environments (when@test) enables reproducible testing pipelines.

    Also to note: jev-symfony-bundle has been indexed in the community ecosystem directory (yibie/awesome-jev) under Infra / SDKs / Integrations (PR #218) so PHP/Symfony developers can easily discover it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions