mrkeyoor.com_
Wed 16 Sept 23:52 UTC
AI Toolsevaluationupdated 26 Aug 2026

kratos review

Kratos is a Go framework for building microservices with Protobuf-defined HTTP and gRPC APIs. It supplies transports, middleware, configuration, service discovery, logging, validation, telemetry hooks, and code generation; it is general backend infrastructure, not an AI model or agent framework.

+8stars / 7d
Verdict

Our Kratos checkout installed in 27 seconds, built in 45, and passed all 44 Go test packages, making it the strongest measured source baseline in this batch. Use it when a Go team genuinely wants Protobuf-first HTTP and gRPC services with shared middleware and operational conventions. Do not choose it for AI features or a small JSON API; those jobs need a model layer or a narrower HTTP framework.

We ran it

Lab card: what happened when we ran kratosScreenshot of kratos (go-kratos.dev)
Install✓ · 27s53 packages
Build✓ · 45s
Tests✓ · 27s44 passed · 0 failed of 44 (go test)
Repo465 files~45,874 lines of source · 6.5 MB · 6 CI workflows

Answers from our run

Does kratos build from source?

Dependencies installed in 27 seconds (53 packages), and the build succeeded in 45 seconds. We cloned commit 668db92 into a clean Debian container with 3 CPUs and no project-specific setup.

Do kratos's tests pass?

Yes: 44 of 44 passed when we ran the project's own test command (go test). Some failures need services or credentials a bare container does not have.

Who should not use kratos?

Developers seeking an AI agent or inference framework: the README describes general microservice transport and middleware, with no model runtime.

What are the alternatives to kratos?

go-kit, go-zero, Gin. Our Kratos checkout installed in 27 seconds, built in 45, and passed all 44 Go test packages, making it the strongest measured source baseline in this batch.

Setup4/5Clean measured run, with protoc and generators required for real services
Docs4/5Clear v3 start and migration path, backed by component documentation
Community5/525,891 stars, recent fixes, bilingual docs, and active review
Maturity4/5All 44 packages passed, while v3 remains a breaking transition

Discussed on

  1. hnShow HN: Go-kratos – Golang microservices framework10 points

Who it’s for

Go teams building several HTTP and gRPC services from shared Protobuf contracts.
Platform groups that want consistent logging, tracing, metrics, errors, validation, and discovery hooks.
AI product teams that need an ordinary service framework around model gateways or workers.
Organizations prepared to standardize on generated code and a prescribed project layout.

Who it’s NOT for

Developers seeking an AI agent or inference framework: the README describes general microservice transport and middleware, with no model runtime.
Small services that only need a few HTTP routes: Kratos adds Protobuf, generators, a CLI, middleware conventions, and project structure.
Teams pinned below Go 1.25: the current README makes Go 1.25 or later a requirement.
Projects unwilling to install protoc and protoc-gen-go: both are prerequisites for the API-first generated workflow.
Kratos v2 applications expecting a drop-in update: v3.0.0 is marked as breaking and has a dedicated migration guide.
Operators assuming every contrib module moves in lockstep: issue #3861 reports different Nacos SDK generations between registry and config modules.

Setup reality

Our sandbox installed 53 Go packages in 27 seconds, built Kratos in 45 seconds, and ran all 44 test packages in 27 seconds with 44 passing and 0 failing. That is the cleanest measured contributor path in this group.

The CLI requires Go 1.25 or later. The documented generated-service flow also needs protoc and protoc-gen-go; optional registries, configuration stores, and telemetry backends bring their own services and credentials. The minimal example listens on HTTP port 8000 and gRPC port 9000.

The checkout had 465 files, about 45,874 source lines, 6 CI workflows, no Dockerfile, and no dedicated tests directory. Version 3 changes module paths and makes earlier implicit behavior explicit, so existing v2 services need the migration guide and integration tests before an upgrade.

Kratos v3 is a microservice framework, not an AI stack

Kratos provides a Go application shell for services that expose HTTP and gRPC from Protobuf contracts. Its core covers transports, middleware, configuration, logging, encoding, validation, metadata, errors, and code generation. Contrib modules connect registries, config stores, middleware, encodings, and observability systems. There is no language model, vector store, agent loop, or inference server in the README.

That distinction matters because this review sits in an AI-tools category. Kratos can host an AI gateway or a model-backed business service, but it contributes the same infrastructure it would give a payments or inventory service. Choose it for API contracts and service operations. Bring your own model provider, queue, data store, prompt layer, evaluation system, and safety controls.

The framework's main opinion is API-first development. Define a Protobuf service, generate client and server bindings, implement business logic, then run HTTP and gRPC through common application lifecycle code. The small example listens on port 8000 for HTTP and 9000 for gRPC. Generated OpenAPI and consistent errors can keep several clients aligned with the same contract.

Go 1.25 and Protobuf are real prerequisites

The current README requires Go 1.25 or later, protoc, and protoc-gen-go. Installing the Kratos v3 CLI is one Go command, after which kratos new helloworld, go mod tidy, and kratos run produce a starting service. A fuller workflow adds a .proto file, generates clients and server stubs, runs go generate, and starts the application.

This machinery pays off across a service fleet, where generated contracts and standard middleware remove repeated decisions. It is harder to justify for a small HTTP endpoint. A developer has to understand Protobuf annotations, generated files, module versions, transport mappings, dependency injection in the chosen layout, and how errors cross HTTP and gRPC. Gin or the standard library is a shorter path when none of that coordination is needed.

External infrastructure remains external. Registry and configuration interfaces can connect to systems such as Nacos through contrib modules, while OpenTelemetry extensions connect service signals to an observability backend. Those components need addresses, credentials, deployment, and failure policy. Kratos gives them common interfaces; it does not operate the registry, certificate authority, trace collector, or configuration store.

What happened when we ran it

Our run at commit 668db92 installed 53 Go packages in 27 seconds and completed the build in 45 seconds. The test command finished in 27 seconds with all 44 packages passing and 0 failing. Among these seven reviews, Kratos was the only runnable repository whose measured test suite finished with no failures.

The checkout contained 465 files, about 45,874 lines of source, and occupied 6.5 MB. It had 6 CI workflow files, no Dockerfile, and no dedicated tests directory. Tests living beside Go packages are normal, so the missing top-level directory is not evidence of missing coverage. The 44-to-0 result is the evidence that matters for this commit and sandbox.

Our 3-CPU, 8 GB fresh Debian container measured the framework repository, not a generated service connected to gRPC clients, a registry, or telemetry. No credentials or external services were required for this lab path. A production evaluation should generate one representative API, exercise both transports, force middleware errors, and verify shutdown plus dependency failures.

Version 3 makes the upgrade boundary explicit

Release v3.0.0 shipped on 2026-06-26 and labels its module update a breaking change. The README says v3 reduces core dependencies and turns previously implicit behavior into explicit choices. Existing v2 applications should use the dedicated migration guide rather than changing the module path and waiting for compiler errors to reveal behavioral differences.

The release added standard-library error wrappers, HTTP streaming deadline controls, google.api.HttpBody responses, generic configuration reads, JWT parser options, custom validators, and new HTTP error mappings. Fixes covered transport mutation, hot-reload file events, config watcher panics, histogram names, service names, and registry clients. That is a broad service boundary, and each adopted component deserves an integration test.

Contrib versions can diverge. Issue #3861 reports that the v3 registry module used Nacos SDK v2.3.5 while the configuration module used v1.1.6; a subsequent pull request updates the config side to v2. This specific mismatch may move quickly, but it shows why a team should lock the complete module graph instead of assuming the Kratos major version settles every integration version.

Bind errors and metadata have current fixes in review

Issue #3815 says HTTP bind errors bypassed the middleware chain, so logging, tracing, and recovery did not execute for that path. Pull request #3877 changes bind errors to pass through middleware. Another current fix percent-encodes non-ASCII metadata for transport headers, and a separate change supports array values in forwarded gRPC headers. These are the sort of boundary cases a dual-transport framework must handle consistently.

Repository health looks good. Kratos v3.0.0 was followed by code and review activity through 2026-08-25, while the last repository push was 2026-08-19. GitHub listed 107 open issues and pull requests together. The project has 25,891 stars, an MIT license, English and Simplified Chinese READMEs, a documentation site, examples, a layout repository, Discord, and WeChat channels.

Kratos is an easy technical recommendation for a Go service fleet that accepts its Protobuf and generator choices. Our 44-package clean run supports the source quality claim more directly than stars do. For one HTTP service, use Gin or plain Go. For an AI system, use Kratos only as the service chassis, then evaluate the model and data layers separately.

Alternatives

ProjectWhat it isPick it when
go-kitA collection of Go packages and patterns for service development with less framework prescription.pick this instead when your team wants composable service primitives and will design its own project shape.
go-zero gh↗A Go microservice framework with code generation, RPC, configuration, and operational components.pick this instead when you prefer go-zero's generators and integrated conventions for a service fleet.
Gin gh↗A focused Go HTTP framework for routing and middleware without a full microservice stack.pick this instead when one HTTP API does not need Protobuf-first gRPC, discovery, or Kratos project generation.

Sources

  1. Kratos repository README
  2. Kratos repository facts
  3. Kratos v3.0.0 release
  4. Nacos SDK version mismatch issue
  5. HTTP bind middleware issue
  6. Kratos v2 to v3 migration guide

More ai tools reviews

eve · MemOS · LongCat-Video · Concat · DLSS5-Feeder · Concat · the whole board →