Documentation
¶
There is no documentation for this package.
Directories
¶
| Path | Synopsis |
|---|---|
|
benchmarks
|
|
|
gateway/cmd/gwbench
command
Command gwbench measures the latency the AI Gateway adds for an end user, and how it holds up under load.
|
Command gwbench measures the latency the AI Gateway adds for an end user, and how it holds up under load. |
|
gateway/cmd/mockllm
command
Command mockllm is the benchmark upstream: an OpenAI- and Anthropic-shaped LLM server that paces its output to a configurable profile (first-token delay, token rate, output length) and records nothing per request, so it can sustain far more load than the gateway under test.
|
Command mockllm is the benchmark upstream: an OpenAI- and Anthropic-shaped LLM server that paces its output to a configurable profile (first-token delay, token rate, output length) and records nothing per request, so it can sustain far more load than the gateway under test. |
|
gateway/internal/probe
Package probe sends one LLM request and times it from the client's point of view: time to response headers, time to the first content token, and time to the end of the body.
|
Package probe sends one LLM request and times it from the client's point of view: time to response headers, time to the first content token, and time to the end of the body. |
|
gateway/internal/report
Package report turns a run directory (manifest.json, results.jsonl, samples.jsonl) into summary.json, report.md and report.html.
|
Package report turns a run directory (manifest.json, results.jsonl, samples.jsonl) into summary.json, report.md and report.html. |
|
gateway/internal/run
Package run executes a resolved scenario: it drives every cell, writes each request's measurements to results.jsonl, samples the gateway's resource use alongside, and records a manifest describing exactly what was measured.
|
Package run executes a resolved scenario: it drives every cell, writes each request's measurements to results.jsonl, samples the gateway's resource use alongside, and records a manifest describing exactly what was measured. |
|
gateway/internal/sampler
Package sampler records the gateway's resource use during a run: RSS, CPU seconds, goroutines, open file descriptors and heap, scraped once a second from its Prometheus endpoint, plus the mock upstream's request counters.
|
Package sampler records the gateway's resource use during a run: RSS, CPU seconds, goroutines, open file descriptors and heap, scraped once a second from its Prometheus endpoint, plus the mock upstream's request counters. |
|
gateway/internal/scenario
Package scenario loads benchmark scenario files and resolves them into runnable cells: which targets each arm hits, with which body, under which load shape.
|
Package scenario loads benchmark scenario files and resolves them into runnable cells: which targets each arm hits, with which body, under which load shape. |
|
gateway/internal/sched
Package sched drives load at a cell's arms and streams every Result to a sink.
|
Package sched drives load at a cell's arms and streams every Result to a sink. |
|
gateway/internal/seed
Package seed configures a fresh Studio (hub) and its edge gateway for a benchmark run, headlessly, over Studio's REST API: first admin, API key, LLMs pointing at the mock and the real vendors, model prices, an app with a budget and an active credential, then a config push to the edges and a wait until every edge has loaded it.
|
Package seed configures a fresh Studio (hub) and its edge gateway for a benchmark run, headlessly, over Studio's REST API: first admin, API key, LLMs pointing at the mock and the real vendors, model prices, an app with a budget and an active credential, then a config push to the edges and a wait until every edge has loaded it. |
|
gateway/internal/stats
Package stats holds the few estimators the report relies on: exact percentiles, and bootstrap confidence intervals for a difference of medians (independent samples) and for a median of paired differences.
|
Package stats holds the few estimators the report relies on: exact percentiles, and bootstrap confidence intervals for a difference of medians (independent samples) and for a median of paired differences. |
|
cmd
|
|
|
plugin-scaffold
command
Package main provides a CLI tool for scaffolding new Tyk AI Studio plugins.
|
Package main provides a CLI tool for scaffolding new Tyk AI Studio plugins. |
|
swagger
Package swagger Code generated by swaggo/swag.
|
Package swagger Code generated by swaggo/swag. |
|
examples
|
|
|
embed-host
command
Command embed-host is a minimal application that embeds AI Studio: it signs users in with its own (deliberately trivial) login page, serves Studio under /ai-studio, and lets Studio provision and authorise the users it vouches for.
|
Command embed-host is a minimal application that embeds AI Studio: it signs users in with its own (deliberately trivial) login page, serves Studio under /ai-studio, and lets Studio provision and authorise the users it vouches for. |
|
file-based-demo
command
Package main provides a comprehensive file-based demo of the AI Gateway Library.
|
Package main provides a comprehensive file-based demo of the AI Gateway Library. |
|
file-based-demo/filter_test
command
|
|
|
file-based-demo/services
Package services provides file-based implementations of the AI Gateway service interfaces.
|
Package services provides file-based implementations of the AI Gateway service interfaces. |
|
plugins/gateway/legacy-collectors/elasticsearch_collector
command
plugins/examples/elasticsearch_collector/main.go
|
plugins/examples/elasticsearch_collector/main.go |
|
plugins/gateway/legacy-collectors/file_analytics_collector
command
plugins/examples/file_analytics_collector/main.go
|
plugins/examples/file_analytics_collector/main.go |
|
plugins/gateway/legacy-collectors/file_budget_collector
command
plugins/examples/file_budget_collector/main.go
|
plugins/examples/file_budget_collector/main.go |
|
plugins/gateway/legacy-collectors/file_proxy_collector
command
plugins/examples/file_proxy_collector/main.go
|
plugins/examples/file_proxy_collector/main.go |
|
standalone-gateway
command
Package main provides a simple example of using the AI Gateway library to create a standalone microproxy service.
|
Package main provides a simple example of using the AI Gateway library to create a standalone microproxy service. |
|
grpc/control_server.go
|
grpc/control_server.go |
|
Package guardrails is the provider framework behind guardrail filters: a filter kind that classifies text with a typed provider (the built-in pattern library, or an external classifier or NER service) instead of a script, and blocks, redacts or logs on the verdict.
|
Package guardrails is the provider framework behind guardrail filters: a filter kind that classifies text with a typed provider (the built-in pattern library, or an external classifier or NER service) instead of a script, and blocks, redacts or logs on the verdict. |
|
example
command
|
|
|
performance
|
|
|
framework
Package framework provides concurrent load testing utilities
|
Package framework provides concurrent load testing utilities |
|
pkg
|
|
|
aigateway
Package aigateway provides a simple interface to use the Midsommar AI Gateway as an importable library in standalone applications.
|
Package aigateway provides a simple interface to use the Midsommar AI Gateway as an importable library in standalone applications. |
|
authidentity
Package authidentity carries who authenticated a gateway request, and how, on the request context.
|
Package authidentity carries who authenticated a gateway request, and how, on the request context. |
|
authz
Package authz defines the permission vocabulary used by role-based access control.
|
Package authz defines the permission vocabulary used by role-based access control. |
|
cluster
Package cluster lets several Studio replicas share one database: it registers each replica (Node) so others can tell live replicas from dead ones, and carries events every replica must see (Log).
|
Package cluster lets several Studio replicas share one database: it registers each replica (Node) so others can tell live replicas from dead ones, and carries events every replica must see (Log). |
|
corsutil
Package corsutil centralizes the CORS policy for endpoints that historically sent `Access-Control-Allow-Origin: *` (OAuth, proxy metadata, plugin assets).
|
Package corsutil centralizes the CORS policy for endpoints that historically sent `Access-Control-Allow-Origin: *` (OAuth, proxy metadata, plugin assets). |
|
eventbridge
Package eventbridge provides an event bus system for communication between AI Studio (control) and Microgateway (edge) nodes using simonfxr/pubsub for in-process event buses and gRPC for cross-node event forwarding.
|
Package eventbridge provides an event bus system for communication between AI Studio (control) and Microgateway (edge) nodes using simonfxr/pubsub for in-process event buses and gRPC for cross-node event forwarding. |
|
gatewayplugin/interfaces
plugins/interfaces/auth.go
|
plugins/interfaces/auth.go |
|
gatewayplugin/sdk
plugins/sdk/conversions.go
|
plugins/sdk/conversions.go |
|
lrucache
Package lrucache is a small bounded cache keyed by string: least recently used entries are evicted at capacity, and a value that is missing is built once even when many goroutines ask for it at the same moment.
|
Package lrucache is a small bounded cache keyed by string: least recently used entries are evicted at capacity, and a value that is missing is built once even when many goroutines ask for it at the same moment. |
|
mcpintrospect
Package mcpintrospect asks a remote MCP server which tools it offers.
|
Package mcpintrospect asks a remote MCP server which tools it offers. |
|
middleware
Package middleware provides HTTP middleware shared between AI Studio and the Microgateway.
|
Package middleware provides HTTP middleware shared between AI Studio and the Microgateway. |
|
modelmatch
Package modelmatch is the single implementation of the LLM "allowed models" matching rule.
|
Package modelmatch is the single implementation of the LLM "allowed models" matching rule. |
|
netguard
Package netguard provides SSRF safeguards for outbound requests whose destination is derived from stored configuration (LLM upstream endpoints, OCI registries).
|
Package netguard provides SSRF safeguards for outbound requests whose destination is derived from stored configuration (LLM upstream endpoints, OCI registries). |
|
oauthscope
Package oauthscope is the single definition of the OAuth scopes this platform issues and enforces.
|
Package oauthscope is the single definition of the OAuth scopes this platform issues and enforces. |
|
ociplugins
pkg/ociplugins/client.go
|
pkg/ociplugins/client.go |
|
pathcheck
Package pathcheck reports, once at startup, every filesystem path a binary is configured with: where the value came from (set, or the built-in default), the absolute path it resolves to from the working directory, and whether the file or directory is there and usable by the process user.
|
Package pathcheck reports, once at startup, every filesystem path a binary is configured with: where the value came from (set, or the built-in default), the absolute path it resolves to from the working directory, and whether the file or directory is there and usable by the process user. |
|
pglisten
Package pglisten shares one PostgreSQL LISTEN connection per database among every subscriber in the process.
|
Package pglisten shares one PostgreSQL LISTEN connection per database among every subscriber in the process. |
|
plugin_sdk
Package plugin_sdk provides a unified SDK for building plugins that work in both AI Studio and Microgateway contexts.
|
Package plugin_sdk provides a unified SDK for building plugins that work in both AI Studio and Microgateway contexts. |
|
replicas
Package replicas is how code anywhere in Studio (core or Enterprise) cooperates with the other control-plane replicas sharing its database, without being handed the cluster machinery:
|
Package replicas is how code anywhere in Studio (core or Enterprise) cooperates with the other control-plane replicas sharing its database, without being handed the cluster machinery: |
|
safe
Package safe keeps a panic in Studio's background work from taking the whole process down.
|
Package safe keeps a panic in Studio's background work from taking the whole process down. |
|
semanticrouting
Package semanticrouting holds the shared shape of a Semantic Router: the configuration an administrator writes, what the classifier is asked, and what it answers.
|
Package semanticrouting holds the shared shape of a Semantic Router: the configuration an administrator writes, what the classifier is asked, and what it answers. |
|
semanticrouting/llmclient
Package llmclient reaches LLMs for the Semantic Router engine: embeddings for the example and request vectors, and a completion for the judge.
|
Package llmclient reaches LLMs for the Semantic Router engine: embeddings for the example and request vectors, and a completion for the judge. |
|
studio
Package studio runs Tyk AI Studio inside another Go process.
|
Package studio runs Tyk AI Studio inside another Go process. |
|
studio/sqlitedb
Package sqlitedb adds SQLite to studio.OpenDatabase.
|
Package sqlitedb adds SQLite to studio.OpenDatabase. |
|
testinfra/containers
Package containers provides testcontainers-go helpers for integration testing.
|
Package containers provides testcontainers-go helpers for integration testing. |
|
testinfra/mockllm
Package mockllm provides mock LLM backends for E2E testing.
|
Package mockllm provides mock LLM backends for E2E testing. |
|
testinfra/plugintest
Package plugintest provides E2E testing utilities for plugins.
|
Package plugintest provides E2E testing utilities for plugins. |
|
testinfra/vendorconformance
Package vendorconformance holds the shared, module-neutral half of the live vendor conformance suite: configuration loading, the vendor/surface/scenario support matrix, canonical wire schemas, response normalization and drift detection.
|
Package vendorconformance holds the shared, module-neutral half of the live vendor conformance suite: configuration loading, the vendor/surface/scenario support matrix, canonical wire schemas, response normalization and drift detection. |
|
tracing
Package tracing wires OpenTelemetry distributed tracing for the LLM proxy.
|
Package tracing wires OpenTelemetry distributed tracing for the LLM proxy. |
|
engine
Package engine is the hook through which the enterprise edition supplies the filter script runtime, and the types scripts exchange with it.
|
Package engine is the hook through which the enterprise edition supplies the filter script runtime, and the types scripts exchange with it. |
|
services/plugin_event_service.go Host-side implementation of PluginEventService for AI Studio (control instance).
|
services/plugin_event_service.go Host-side implementation of PluginEventService for AI Studio (control instance). |
|
audit
Package audit defines the platform audit trail: an append-only record of every action taken through the management API, who took it, from where, and what changed.
|
Package audit defines the platform audit trail: an append-only record of every action taken through the management API, who took it, from where, and what changed. |
|
edition
Package edition checks that a build carries every enterprise feature it was compiled for.
|
Package edition checks that a build carries every enterprise feature it was compiled for. |
|
governed_metadata
Package governed_metadata defines the Governed Metadata service used to attach admin-defined, validated metadata (owners, lifecycle state, risk tier, data classification, ...) to objects that AI Studio publishes to the portal or to edge gateways (LLMs, Tools, Datasources, and opted-in plugin resource types).
|
Package governed_metadata defines the Governed Metadata service used to attach admin-defined, validated metadata (owners, lifecycle state, risk tier, data classification, ...) to objects that AI Studio publishes to the portal or to edge gateways (LLMs, Tools, Datasources, and opted-in plugin resource types). |
|
plugin_security
Package plugin_security provides security validation for plugins in both CE and ENT editions
|
Package plugin_security provides security validation for plugins in both CE and ENT editions |
|
pushes
Package pushes delivers configuration pushes ("reloads") to edge gateways when several Studio replicas share the database.
|
Package pushes delivers configuration pushes ("reloads") to edge gateways when several Studio replicas share the database. |
|
rbac
Package rbac defines role-based access control for the management API: roles are named bundles of catalogue permissions (see pkg/authz), bound to users or groups; a user's effective permissions are the union across their direct bindings and the bindings of every group they belong to.
|
Package rbac defines role-based access control for the management API: roles are named bundles of catalogue permissions (see pkg/authz), bound to users or groups; a user's effective permissions are the union across their direct bindings and the bindings of every group they belong to. |
|
semantic_router
Package semantic_router manages Semantic Routers (Enterprise): routers that pick one of their named routes from what the prompt says.
|
Package semantic_router manages Semantic Routers (Enterprise): routers that pick one of their named routes from what the prompt says. |
|
team_budget
Package team_budget defines team (Group) level budgets: a monthly ceiling on the combined spend of a team's Apps, and an allocation pool that new Apps in the team draw their App budget from.
|
Package team_budget defines team (Group) level budgets: a monthly ceiling on the combined spend of a team's Apps, and an allocation pool that new Apps in the team draw their App budget from. |
|
tykmcp
Package tykmcp defines the Tyk Dashboard MCP integration: MCP proxies defined in a Tyk Dashboard are discovered and published to the AI Portal as an asset class, registered from Studio into the Dashboard, proposed by portal users through the submission workflow, and access keys are brokered against Tyk security policies.
|
Package tykmcp defines the Tyk Dashboard MCP integration: MCP proxies defined in a Tyk Dashboard are discovered and published to the AI Portal as an asset class, registered from Studio into the Dashboard, proposed by portal users through the submission workflow, and access keys are brokered against Tyk security policies. |
|
webhooks
Package webhooks defines outbound webhook delivery: event-bus events are persisted, fanned out to administrator-approved HTTP targets, delivered with retries and a dead-letter queue, and every attempt is logged so an operator can search what was sent where, when, and what came back.
|
Package webhooks defines outbound webhook delivery: event-bus events are persisted, fanned out to administrator-approved HTTP targets, delivered with retries and a dead-letter queue, and every attempt is logged so an operator can search what was sent where, when, and what came back. |
|
pckage switches is the place where all vendor-dependent logic lives.
|
pckage switches is the place where all vendor-dependent logic lives. |
|
Package templates holds the default email and notification templates.
|
Package templates holds the default email and notification templates. |
|
schemasnapshot
Package schemasnapshot renders the schema a migration produced as stable text, so tests can compare it with a golden file.
|
Package schemasnapshot renders the schema a migration produced as stable text, so tests can compare it with a golden file. |
|
third_party
|
|
|
langchaingo/callbacks
Package callbacks includes a standard interface for hooking into various stages of your LLM application.
|
Package callbacks includes a standard interface for hooking into various stages of your LLM application. |
|
langchaingo/chains
Package chains contains a standard interface for chains, a number of built-in chains and functions for calling and running chains.
|
Package chains contains a standard interface for chains, a number of built-in chains and functions for calling and running chains. |
|
langchaingo/embeddings
Package embeddings contains helpers for creating vector embeddings from text using different providers.
|
Package embeddings contains helpers for creating vector embeddings from text using different providers. |
|
langchaingo/httputil
Package httputil provides HTTP transport and client utilities for LangChainGo.
|
Package httputil provides HTTP transport and client utilities for LangChainGo. |
|
langchaingo/internal/httprr
Package httprr implements HTTP record and replay, mainly for use in tests.
|
Package httprr implements HTTP record and replay, mainly for use in tests. |
|
langchaingo/llms
Package llms provides unified support for interacting with different Language Models (LLMs) from various providers.
|
Package llms provides unified support for interacting with different Language Models (LLMs) from various providers. |
|
langchaingo/llms/googleai
Package googleai provides caching support for Google AI models.
|
Package googleai provides caching support for Google AI models. |
|
langchaingo/llms/googleai/vertex
package vertex implements a langchaingo provider for Google Vertex AI LLMs, including the new Gemini models.
|
package vertex implements a langchaingo provider for Google Vertex AI LLMs, including the new Gemini models. |
|
langchaingo/llms/openai
Package openai provides an interface to OpenAI's language models.
|
Package openai provides an interface to OpenAI's language models. |
|
langchaingo/memory
Package memory provides an interface for managing conversational data and a variety of implementations for storing and retrieving that data.
|
Package memory provides an interface for managing conversational data and a variety of implementations for storing and retrieving that data. |
|
langchaingo/outputparser
Package outputparser provides a set of output parsers to process structured or unstructured data from language models (LLMs).
|
Package outputparser provides a set of output parsers to process structured or unstructured data from language models (LLMs). |
|
langchaingo/prompts
Package prompts provides utilities for creating and managing prompts for Large Language Models (LLMs).
|
Package prompts provides utilities for creating and managing prompts for Large Language Models (LLMs). |
|
langchaingo/prompts/internal/fstring
Package fstring contains template format with f-string.
|
Package fstring contains template format with f-string. |
|
langchaingo/prompts/internal/loader
Package loader provides secure filesystem access control for template engines.
|
Package loader provides secure filesystem access control for template engines. |
|
langchaingo/schema
Package schema implements a shared core set of data types for use in langchaingo.
|
Package schema implements a shared core set of data types for use in langchaingo. |
|
langchaingo/testing/llmtest
Package llmtest provides utilities for testing LLM implementations.
|
Package llmtest provides utilities for testing LLM implementations. |
|
langchaingo/textsplitter
Package textsplitter provides tools for splitting long texts into smaller chunks based on configurable rules and parameters.
|
Package textsplitter provides tools for splitting long texts into smaller chunks based on configurable rules and parameters. |
|
langchaingo/vectorstores
Package vectorstores contains the implementation of VectorStore, an interface for saving and querying documents as vector embeddings.
|
Package vectorstores contains the implementation of VectorStore, an interface for saving and querying documents as vector embeddings. |
|
langchaingo/vectorstores/chroma
Package chroma contains an implementation of the VectorStore interface that connects to an external Chroma database.
|
Package chroma contains an implementation of the VectorStore interface that connects to an external Chroma database. |
|
langchaingo/vectorstores/pgvector
Package pgvector contains an implementation of the VectorStore interface using pgvector.
|
Package pgvector contains an implementation of the VectorStore interface using pgvector. |
|
langchaingo/vectorstores/pinecone
Package pinecone contains an implementation of the VectorStore interface using pinecone.
|
Package pinecone contains an implementation of the VectorStore interface using pinecone. |
|
langchaingo/vectorstores/qdrant
Package qdrant contains an implementation of the VectorStore interface using Qdrant.
|
Package qdrant contains an implementation of the VectorStore interface using Qdrant. |
|
langchaingo/vectorstores/redisvector
Package redisvector contains an implementation of the VectorStore interface using redisvector.
|
Package redisvector contains an implementation of the VectorStore interface using redisvector. |
|
langchaingo/vectorstores/weaviate
Package weaviate contains an implementation of the VectorStore interface using weaviate.
|
Package weaviate contains an implementation of the VectorStore interface using weaviate. |
|
tools
|
|
|
gendata
command
|
|
|
Package ui holds the built admin frontend.
|
Package ui holds the built admin frontend. |
|
proxy-tests/anthropic
command
|
|
|
proxy-tests/ollama
command
|
|
|
proxy-tests/openai
command
|
|
|
proxy-tests/vertex
command
|
|
|
uc
command
|
|
|
vendors
|
|
Click to show internal directories.
Click to hide internal directories.