Rafi StacksA NEIGHBORHOOD OF IDEASHobart, Tasmania ↗
← All journal entries
FIELD NOTES / 001AI & SYSTEMS

Researching the Next Generation of AI-Native Backend Frameworks

Beyond requests per second: exploring the tools, trade-offs, and open questions behind a more reliable AI backend.

A NOTE BEFORE READING

This is exploratory research based on public documentation and comparative analysis. Independent benchmarks and market validation are still ahead.

1. Background and Motivation

Recently, I started researching the possibility of developing a new backend API framework that could offer better performance, simpler syntax, stronger security defaults, and built-in AI integration.

My initial question was quite simple:

Can I build something faster than FastAPI while making it equally easy, or even easier, for developers to use?

Having worked with FastAPI on AI-based applications, including my Hobart College AI chatbot project, I have experienced both its strengths and the additional engineering work required to build a reliable application around it.

FastAPI already provides an excellent developer experience through Python type hints, automatic request validation, asynchronous endpoints, and generated API documentation.

However, building a complete AI application involves considerably more than creating HTTP endpoints. Developers still need to handle LLM integration, streaming, context management, resource limits, authentication, retrieval, logging, and answer evaluation.

This led me to investigate whether a new framework could simplify these responsibilities while offering improved runtime performance.

2. Research Objectives

I focused my research on five main questions:

  1. Which programming languages and frameworks offer significantly higher API performance than FastAPI?
  2. Can compiled languages provide similarly concise syntax, automatic validation, and generated documentation?
  3. How much does HTTP framework performance realistically matter in AI applications?
  4. Which AI infrastructure features are already available in existing products?
  5. Where is there still room for innovation, particularly for individual developers and smaller teams?

I also wanted to understand whether developing an entirely new framework would be worthwhile or whether improving existing infrastructure would be a more practical approach.

3. Research Methodology

I conducted exploratory desk research by comparing official framework documentation, publicly available benchmarking methodologies, developer survey results, and existing AI infrastructure platforms.

I examined languages and frameworks including Rust, Go, C++, C#, Python, and TypeScript.

I also studied platforms working on AI orchestration, model gateways, observability, and application evaluation.

The research involved technical comparisons and architectural reasoning. I have not yet performed independent runtime benchmarks, user interviews, or a commercial market validation study.

4. Research Findings

4.1 High-Performance API Frameworks Already Exist

My first finding was that several existing frameworks already solve significant parts of the problem.

Technology Strengths Limitations relevant to my goal
FastAPI — Python Minimal syntax, validation, async, OpenAPI, extensive AI ecosystem Python execution overhead for CPU-intensive work
Robyn — Python/Rust Rust-powered runtime, familiar Python routes, Pydantic validation, OpenAPI Python handlers still involve Python execution
Axum — Rust High performance potential, async runtime, strong memory-safety guarantees Advanced convenience features require additional components
Huma — Go Simple typed APIs, automatic validation, OpenAPI documentation Does not provide my proposed AI reliability workflow out of the box
ASP.NET Core Minimal APIs — C# High performance, concise endpoints, validation, OpenAPI integration AI-specific reliability infrastructure is still application-dependent
Drogon — C++ Efficient native backend framework More complex type handling and memory-safety responsibilities
Elysia — TypeScript/Bun Concise syntax, TypeScript development experience Runtime performance depends on workload and deployment

One particularly interesting discovery was Robyn.

Robyn already combines a Rust-based HTTP runtime with Python application development. It also supports Pydantic request validation and OpenAPI generation.

This meant my original idea of combining native performance with simple Python syntax was not entirely new.

I also examined Huma and ASP.NET Core Minimal APIs, which demonstrate that typed request handling, validation, and concise API definitions can be achieved outside Python.

My conclusion: Building another fast REST framework would not automatically create something valuable. A new framework would need a stronger reason for developers to adopt it.

4.2 Framework Speed Does Not Always Mean Application Speed

I examined the TechEmpower Framework Benchmarks, particularly Round 23, published in February 2025.

The results demonstrate substantial performance differences between specific framework implementations in standardized workloads such as JSON serialization, database queries, and plaintext responses.

However, these benchmarks cannot directly predict the performance of a complete AI application.

For example, consider a hypothetical AI request taking 2,000 milliseconds, with only 20 milliseconds spent in the framework layer.

Even if I made that framework processing five times faster, the total request would take approximately 1,984 milliseconds — an improvement of only 0.8%.

This was an important finding.

For a standard HTTP endpoint, a faster runtime can significantly improve throughput and infrastructure efficiency.

For an AI chatbot, external inference, database retrieval, and tool execution can dominate response time.

Therefore, I started looking beyond raw HTTP requests per second.

A more useful performance objective would be reducing latency, infrastructure overhead, and cost per successfully completed AI task.

4.3 The AI Infrastructure Market Is Already Competitive

I explored several categories of existing AI development tools.

AI application frameworks: Mastra, Pydantic AI, and Rig already offer capabilities for interacting with models, building agents, handling tools, and managing application workflows.

AI gateways: Cloudflare AI Gateway, Vercel AI Gateway, and LiteLLM provide various combinations of provider routing, caching, rate limits, cost monitoring, and failover.

Observability and evaluation: Langfuse and similar platforms already provide request tracing, evaluation datasets, experiments, and monitoring.

These findings changed my original thinking.

Features such as token tracking, prompt caching, AI streaming, and model routing already exist. Providing them alone would not be enough to compete with established platforms.

The opportunity may lie in how these capabilities are combined and how much additional engineering developers must perform before an application becomes reliable.

4.4 Developer Trust Is an Important Opportunity

One of the most interesting datasets I found was the 2026 Stack Overflow Developer Survey.

According to the survey:

  • 48% of respondents to the AI trust question said they trust AI output when they can easily verify it.
  • 79% considered source attribution important or very important when evaluating AI-generated technical answers.
  • 93% considered source attribution at least somewhat important.

The trust question had 14,304 respondents, while the source-attribution question had 13,945 respondents.

These findings do not directly measure demand for a new backend framework, but they highlight how important verification and transparency have become in AI-assisted work.

For applications that answer questions using organisational knowledge, the challenge is not simply generating fluent responses.

Developers need ways to verify supporting documents, identify unsupported answers, preserve access permissions, detect failures, and evaluate changes over time.

I believe this is an area worth investigating further.

5. Potential Opportunities Identified

Based on the comparison, I identified four directions.

Opportunity 1: Reliable Knowledge-Based AI Applications

Build developer tools that simplify source-grounded question answering, document retrieval, abstention, feedback collection, and automatic regression testing.

This could be useful in educational institutions, internal helpdesks, customer support, and documentation systems.

The challenge would be demonstrating that the system reliably detects unsupported or incorrect responses.

Opportunity 2: Quality-Aware AI Cost Optimization

Investigate ways to reduce token usage, context size, and unnecessary LLM calls without lowering answer quality.

Rather than selecting the cheapest model automatically, the system could compare candidate configurations against a predefined evaluation dataset.

An important limitation is that providers already support some forms of prompt caching and cost optimization. Any proposed improvement needs to demonstrate additional value.

Opportunity 3: Secure AI Agent Execution

Explore typed API tools, permission checks, approval mechanisms, execution restrictions, and audit trails for AI agents interacting with real business systems.

Rust's memory safety would be helpful at the runtime level, but application-level security would still require careful authorization and policy enforcement.

Opportunity 4: Minimal-Code AI-Native API Development

Develop a framework that combines typed REST endpoints, automatic documentation, asynchronous streaming, provider integration, cost controls, and observability.

Instead of requiring developers to configure several separate services, the framework could provide these capabilities through a small number of declarations.

The challenge is avoiding unnecessary complexity while preserving flexibility for advanced applications.

6. Proposed Technical Direction

After comparing the alternatives, Rust emerged as my preferred candidate for further investigation.

My proposed architecture would use:

  • Rust for the main runtime and framework development.
  • Tokio for asynchronous execution.
  • Axum, Hyper, and Tower for HTTP handling and middleware.
  • Serde and existing validation/schema libraries for typed data processing.
  • Rust procedural macros for concise developer-facing syntax.
  • OpenAPI for automatic API documentation.
  • Optional integrations for LLM providers, vector databases, observability, and evaluation.

I do not currently see a strong reason to invent an entirely new programming language or HTTP protocol implementation.

Building on mature components would allow me to spend more effort on the developer experience and AI-specific capabilities.

The intended design would keep the core API framework lightweight, with AI functionality available through optional modules.

7. Limitations of My Research

There are several important limitations at this stage.

First, I have not developed or benchmarked the proposed framework. I cannot yet claim that it is faster, simpler, or more secure than the alternatives.

Second, benchmark performance depends on specific implementations, workloads, hardware, and deployment configurations. A faster HTTP runtime does not guarantee faster LLM responses.

Third, AI reliability cannot be guaranteed through citations or automated evaluations alone. Generated answers can contain incorrect claims, and evaluation systems can make mistakes.

Fourth, the developer surveys provide useful evidence about attitudes toward AI but do not establish commercial demand for a particular product.

Finally, established AI platforms are continuously improving. Any new project would need to be evaluated against the capabilities available when it is actually released.

8. Next Research and Development Steps

My next goal is to turn these research findings into a small technical experiment.

I plan to compare equivalent API applications built with FastAPI, Robyn, Go/Huma, and Rust/Axum.

The tests should measure throughput, latency, memory consumption, concurrent request handling, and developer effort.

I also want to build a proof-of-concept AI endpoint supporting typed requests, asynchronous streaming, cost tracking, and evaluation hooks.

Using lessons from my previous RAG-based chatbot development, I would test whether these capabilities genuinely reduce the application code and maintenance effort required.

Before committing to the full framework, I also want to validate whether other developers experience the same problems and whether they would adopt a new solution.

9. Personal Reflection

This research changed how I think about software performance and innovation.

Initially, I was focused on creating something faster than FastAPI.

But comparing existing technologies made me realise that technical performance and developer value are not always the same thing.

A framework can be extremely fast and still provide little practical improvement if the main bottleneck is somewhere else.

I also learned that many ideas I initially considered innovative already exist in mature open-source projects or commercial platforms.

Instead of treating that as a reason to abandon the idea, I see it as an opportunity to study what has already been solved and identify where developers still face unnecessary complexity.

The most valuable question I came away with is:

Can I build something that helps developers deliver more reliable AI applications with less code, less infrastructure effort, and measurable improvements in cost and performance?

That is the direction I want to continue exploring.


References and Further Reading

  1. TechEmpower. (2025). Framework Benchmarks, Round 23. https://www.techempower.com/benchmarks/
  2. Stack Overflow. (2026). Developer Survey — AI and Knowledge. https://survey.stackoverflow.co/2026/
  3. Robyn. Pydantic Integration and OpenAPI Documentation. https://robyn.tech/documentation/en/api_reference/pydantic
  4. Huma. Go API Framework and OpenAPI Generation. https://huma.rocks/
  5. Axum. Rust Framework Documentation. https://docs.rs/axum/
  6. Microsoft. ASP.NET Core Minimal APIs. https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis
  7. Cloudflare. AI Gateway Features. https://developers.cloudflare.com/ai-gateway/features/
  8. Langfuse. Observability and Evaluation. https://langfuse.com/
  9. Mastra. AI Application Framework. https://mastra.ai/docs
  10. Pydantic. Pydantic AI Documentation. https://pydantic.dev/docs/ai/overview/
  11. OpenAI. Prompt Caching. https://developers.openai.com/api/docs/guides/prompt-caching

Research note: This is an exploratory technical and market review based on public documentation, published survey data, and comparative analysis. It is not an independently benchmarked framework study or a commercial market-sizing report.

END OF FIELD NOTES / 001Return to the journal ↗