add-llm-provider

Implement LLMProvider interfaces for external language model APIs in KAgentic.

1|Updated Jul 28, 2025
One-click install
npx skills add https://github.com/anoopg87/KAgentic --skill add-llm-provider
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-llm-provider
Source: https://github.com/anoopg87/KAgentic/tree/main/.claude/skills/add-llm-provider
Command: npx skills add https://github.com/anoopg87/KAgentic --skill add-llm-provider

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enable KAgentic users to integrate new language model providers into the framework so agents can call external or local LLM APIs without ad-hoc hacks. The skill removes uncertainty about authentication, request/response formats, retry behavior, and testing when adding a new provider to a Kotlin JVM agent.

Core Features & Use Cases

  • Implement the LLMProvider interface with a single generate(input: String) method and a configurable model selection pattern.
  • Provide authentication patterns (bearer token, custom headers, URL key, or no auth for local), JSON request building, and robust response parsing for varied provider schemas.
  • Add retry logic using exponential backoff, unit tests, and documentation entries so the provider is production-ready and maintainable.
  • Use Case: Integrate Mistral, Together AI, Perplexity, Gemini, Claude, or a local Ollama instance to enable chat and completion functionality in KAgentic-based agents.

Quick Start

Implement a new Kotlin class that implements LLMProvider, wire an HTTP client with the provider's required authentication, add retryWithBackoff for resilience, write basic unit tests, and update README and CHANGELOG.

Frequently Asked Questions about add-llm-provider

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate a new LLM provider into a Kotlin JVM agentic framework?

To integrate a new LLM provider in a Kotlin JVM framework, implement the LLMProvider interface, wire HTTP requests with the required authentication, and add exponential backoff retry logic for production readiness.

What authentication patterns are needed when adding an LLM API to a Kotlin agent?

Adding an LLM API to a Kotlin agent requires handling varied authentication patterns, including bearer tokens, custom headers, URL keys, or no auth for local instances like Ollama, depending on the specific provider's requirements.

Can I use local LLM models like Ollama with a Kotlin agentic framework?

Yes, you can use local LLM models like Ollama by implementing a custom LLMProvider class that uses no authentication and correctly maps the local JSON request and response schemas for text generation.

How do I handle API rate limits and failures when calling external LLM providers in Kotlin?

Handle API rate limits and failures in Kotlin by implementing retry logic with exponential backoff, ensuring your LLMProvider can resiliently manage transient network errors and API throttling during chat and text generation.

What is the best way to test an LLM API integration in a Kotlin application?

The best way to test an LLM API integration in a Kotlin application is to write unit tests that validate your custom LLMProvider's JSON request building, response parsing, and retry behavior before updating documentation.