Dynamic plugins require dynamic builds of Vikat which are not enabled by default to keep Vikat setup easier. If you want to build and try custom plugins on OSS read building dynamically linked Vikat binary
What are Vikat Plugins?
Vikat plugins allow you to extend the gateway’s functionality by intercepting requests and responses. Plugins can modify, log, validate, or enrich data as it flows through the system, giving you powerful hooks into Vikat’s request lifecycle.Use Cases
Custom plugins enable you to:- Transform requests and responses - Modify data before it reaches providers or after it returns
- Add custom validation - Enforce business rules on incoming requests
- Implement custom caching - Cache responses based on custom logic
- Integrate with external systems - Send data to logging, monitoring, or analytics platforms
- Apply custom transformations - Parse, filter, or enrich LLM responses
Plugin Architecture

.so files) that are loaded at runtime by the Vikat gateway.
How Go Plugins Work
Go plugins use theplugin package from the standard library, which allows Go programs to dynamically load code at runtime. Here’s what makes this approach powerful:
- Native Go Integration - Plugins are written in Go and have full access to Vikat’s type system and interfaces
- Dynamic Loading - Plugins can be loaded, unloaded, and reloaded without restarting Vikat
- Type Safety - Go’s type system ensures plugin methods match expected signatures
- Performance - No IPC overhead; plugins run in the same process as Vikat
Building Shared Objects
Plugins must be compiled as shared objects using Go’s-buildmode=plugin flag:
.so file that exports specific functions matching Vikat’s plugin interface:
- v1.4.x+
- v1.3.x
Init(config any) error- Initialize the plugin with configurationGetName() string- Return the plugin nameHTTPTransportPreHook()- Intercept HTTP requests before they enter Vikat core (HTTP transport only)HTTPTransportPostHook()- Intercept HTTP responses after they exit Vikat core (HTTP transport only)PreRequestHook()v1.6.x+ - Once-per-request routing phase: decide provider/model/fallbacksPreLLMHook()- Intercept requests before they reach providers (runs per provider attempt)PostLLMHook()- Process responses after provider calls (runs per provider attempt)Cleanup() error- Clean up resources on shutdown
Platform Requirements
Important Limitations:- Supported Platforms: Linux and macOS (Darwin) only
- No Cross-Compilation: Plugins must be built on the target platform
- Architecture Matching: Plugin and Vikat must use the same architecture (amd64, arm64)
- Go Version Compatibility: Plugin must be built with the same Go version as Vikat
Plugin Lifecycle
- Load - Vikat loads the
.sofile using Go’splugin.Open() - Initialize - Calls
Init()with configuration fromconfig.json - Hook Execution - Calls
PreRequestHook(),PreLLMHook()andPostLLMHook()for each request - Cleanup - Calls
Cleanup()when Vikat shuts down
- v1.4.x+
- v1.3.x
HTTPTransportPreHook- Intercept HTTP requests (HTTP transport only)PreRequestHookv1.6.x+ - Once per request, before any provider call. Routing decisions (provider/model/fallbacks) happen here and propagate to every attempt.PreLLMHook/PreMCPHook- Per provider attempt, registration order, can short-circuit requests- Provider call (if not short-circuited)
PostLLMHook/PostMCPHook- Per provider attempt, reverse order of PreHooksHTTPTransportPostHook- Intercept HTTP responses (HTTP transport only, reverse order)
Next Steps
Ready to build your first plugin? Choose your approach:- Writing Go Plugins - Native Go plugins using shared objects (
.sofiles). Best for performance and full Go ecosystem access. - Writing WASM Plugins (Deprecated) - Legacy WebAssembly plugin guide for existing deployments. Use Go plugins for new development while webhook-based plugins are being added.

