Skip to content

[Feat]: A2A FastAPI Application #21

Closed

Description

@martimfasantos

Description

Currently, the A2A Google SDK provides server implementations in Starlette and a basic HTTP app, but lacks an official FastAPI integration. FastAPI is a widely adopted, modern Python framework with built-in async support, OpenAPI documentation, and strong performance. Many developers (including myself) prefer FastAPI for its ease of use and feature set, making it a natural fit for Google’s SDK.

Performance comparison:

Image
reference

Describe the solution you'd like

Adding an official FastAPI server app to the A2A SDK, alongside the existing Starlette option, would:

  • Provide better integration with FastAPI’s dependency injection system.
  • Allow seamless use of FastAPI’s OpenAPI/Swagger documentation.
  • Improve developer experience for those already using FastAPI in their projects.

Ideally, this would follow a similar structure to the existing Starlette app but leverage FastAPI’s features.

Describe alternatives you've considered

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. didier-durand commented on May 15, 2025

    @didier-durand
    Contributor

    Hi,

    For my understanding: FastAPI is a layer on top of Starlette. So, what is the purpose / advantage of moving A2A app from Starlette to FastAPI ?

    Didier

  2. martimfasantos commented on May 15, 2025

    @martimfasantos
    ContributorAuthor

    @didier-durand You're absolutely right that FastAPI is built on top of Starlette. The key benefit here is that FastAPI adds useful (development) features like automatic OpenAPI docs, validation, and easier route extensibility.

    By exposing the A2A app directly as a FastAPI app, we can take advantage of these features without needing a separate FastAPI wrapper. Otherwise, we'd have to maintain two apps — a FastAPI app that mounts the existing Starlette one (FastAPI docs) — just to get those extras. This change avoids that extra complexity.

  3. didier-durand commented on May 15, 2025

    @didier-durand
    Contributor

    Thanks for the explanations: I now understand your perspective much better.

  4. JerryDaHeLian commented on May 22, 2025

    @JerryDaHeLian

    希望支持vllm 部署的qwen系列大模型服务!

  5. added a commit that references this issue on Jun 4, 2025
    0e66e1f
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions