Repository navigation
docs: showcase README that shows how llmgate works - #21
Merged
Merged
Conversation
Rewrites the README to the engine README's standard: banner, badges, nav, why it exists, and a full how-it-works section covering the Client interface, providers and gateway base URL rules, error classes, the middleware order, router, retry, budget, cache, the adaptive limiter, cost and pricing, prompt caching, tools, capabilities, and the Judge interface with Noul/Choice/Score, batching, the context guard and its fix, and TypeSafe Jev's price and limits (re-read 2026-10-12). Every Go block was vetted against this tree in a scratch module. Every number carries its date and source in a Measured table. Corrections to the old README: PR #19 is merged (the fix is on main but not tagged), and prompt caching on user messages is wired; only caching a system prompt needs a native client. Figures: the banner, stack, limiter and ecosystem figures from the article, plus two new ones (the two seams, the guard fix). Removes the three docs/*.svg diagrams, which omitted the limiter and Judge and drew the stack in the opposite order to the one the README recommends.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters (9)
📒 Files selected for processing (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideRewrites README.md into a comprehensive, dated showcase of llmgate’s Client and Judge seams, provider adapters, middleware ordering, concurrency and cost controls, System One judging, testing, measured results, and ecosystem positioning, while replacing the old diagrams with updated media and removing obsolete SVGs. Sequence diagram for adaptive limiter retriessequenceDiagram
participant Caller
participant Retry as retry.New
participant Limiter as limit.Client
participant Provider
Caller->>Retry: Complete(ctx, req)
Retry->>Limiter: Complete(ctx, req)
Limiter->>Provider: Complete(ctx, req)
Provider-->>Limiter: rate_limited error
Limiter->>Limiter: reduce limit and apply Retry-After
Limiter-->>Retry: error
Retry->>Limiter: Complete(ctx, req)
Limiter->>Provider: Complete(ctx, req)
Provider-->>Limiter: Response
Limiter-->>Retry: Response
Retry-->>Caller: Response
Sequence diagram for batched Judge decisions with context guardsequenceDiagram
participant Caller
participant Judge as typesafe.Judge
participant Guard as Context guard
participant Jev as TypeSafe Jev API
Caller->>Judge: Judge(ctx, JudgeRequest)
Judge->>Guard: CountTokens(ctx, state and questions)
Guard-->>Judge: Valid batch or context_length error
alt batch fits limits
Judge->>Jev: POST one batch of questions
Jev-->>Judge: Noul, Choice and Score answers
Judge-->>Caller: Judgment with Usage
else batch exceeds limits
Judge-->>Caller: context_length error
end
Flow diagram for the ordered Client middleware stackflowchart TD
Request --> Retry[retry.New]
Retry --> Limit[limit.Client]
Limit --> Budget[budget.New]
Budget --> Cache[cache.New]
Cache --> Router[router.New]
Router --> Provider[Provider adapter]
Provider --> Response
CacheHit[Cache hit] --> Response
ProviderError[Rate limit or transient error] --> Retry
ProviderError --> Router
Budget -. cache hits do not debit .-> Cache
Limit -. each retry attempt takes a slot .-> Retry
Flow diagram for provider adaptation and response accountingflowchart LR
Request[llmgate.Request] --> Adapter[internal/adapter]
Adapter --> GenerateContent[langchaingo GenerateContent]
GenerateContent --> Provider[Anthropic / OpenAI / Gemini]
Provider --> GenerateContent
GenerateContent --> Adapter
Adapter --> Response[llmgate.Response]
Response --> Usage[Usage and CostUSD]
Response --> ToolCalls[ToolCalls]
Response --> Capabilities[Capability flags]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrites the README to show how llmgate works:
Adds a Measured table with each figure's date and source, and the Go ecosystem comparison. Figures come from the article plus two new ones (the two seams, the guard fix). The three old SVGs are removed; they left out the limiter and the Judge, and drew the stack backwards.
All 16 Go blocks build and vet against main. Rendered on github.com with 12 images and none broken. Lorx CI green, both
bit run --alland the cloud run (GitHub Actions can't start jobs, HAL-1712).Part of HAL-2755 (control plane and pdfgrab READMEs land separately). No-Linear-Issue: HAL-2755 closes with the last of the three.
Summary by Sourcery
Rewrite the README as a measured, example-driven showcase of llmgate’s client, middleware, provider, and Judge capabilities.
Enhancements:
Documentation: