create_provider_skill

This skill guides you through adding a new provider (LLM, VectorStore, etc.) to Beluga AI with directory layout, interface implementation, and testing.
  • Go

5

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill lookatitude/beluga-ai --skill create_provider

  • SKILL.md1.4 KB

Overview

This skill provides a clear, step-by-step guide to add a new provider (LLM, VectorStore, etc.) into Beluga AI packages written in Go. It explains the required files, interface implementation, configuration decoding, factory registration, and testing structure. Follow these steps to integrate a provider that fits the package provider pattern and works with existing factories and tests.

How this skill works

The guide walks you through creating a provider directory and implementing the package interface with a Provider struct and a New(...) factory function. It covers adding a config struct that uses mapstructure tags for decoding and registering the provider factory in the package registry or init block. Finally, it shows how to add unit tests that use existing test utilities and mocks to validate behavior.

When to use it

  • Adding a new LLM or VectorStore implementation to an existing Beluga package (e.g., pkg/llms or pkg/vectorstores).
  • When the package follows a provider/factory pattern and exposes a well-defined interface to implement.
  • When you need pluggable providers that can be selected via configuration at runtime.
  • When adding CI-tested implementations that should integrate with existing test utilities and mocks.

Best practices

  • Implement the package interface exactly; prefer code that compiles against the interface rather than relying on implicit behavior.
  • Keep the provider folder self-contained: implementation, config, and tests in the same directory.
  • Use mapstructure tags on config fields to ensure consistent decoding from generic config loaders.
  • Register the factory in the package registry so the provider is discoverable by runtime configuration.
  • Write unit tests that exercise both config decoding and runtime behavior using the package's test utilities.

Example use cases

  • Add a new Anthropic LLM provider under pkg/llms/providers/anthropic with anthropic.go, config.go, and anthropic_test.go.
  • Introduce a new vector store implementation and register its factory so users can switch stores via config.
  • Create a mock provider for local development that implements the same interface and plugs into the existing registry.
  • Add a custom provider requiring API keys by defining secure config fields and decoding them via mapstructure.

FAQ

Look in the package's iface folder or the main package file (e.g., pkg/<package>/iface or pkg/<package>/<package>.go).

How do I make the provider selectable at runtime?

Register the provider factory in the package registry (registry.go or factory.go) so configuration can select it by name.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
create_provider skill by lookatitude/beluga-ai | VeilStrat