Adds a new LLM client provider to the clients module. An agent skill from FabioYanezRomero/Knowledge-Graph-Builder.

MITAuto-check passed

Install Add LLM Client

skills CLI
$ npx skills add FabioYanezRomero/Knowledge-Graph-Builder --skill add-llm-client -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install FabioYanezRomero/Knowledge-Graph-Builder add-llm-client --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/FabioYanezRomero/Knowledge-Graph-Builder.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agent/skills/add-llm-client .claude/skills/add-llm-client && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-llm-client
GitHub stars
103
Token cost
~3.8k tokens
SKILL.md length
326 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Adds a new LLM client provider to the clients module. An agent skill from FabioYanezRomero/Knowledge-Graph-Builder.

  • Works in 5 steps: Understand the Interface → Create Provider Defaults → Implement Your Client → …
  • Implementing support for a new LLM provider like Anthropic
  • SKILL.md covers Overview, Architecture, Dependencies and ClientConfig Schema, plus 11 more sections
  • Calls python; reaches api.groq.com; needs GROQ_API_KEY

What it does

Add LLM Client is an agent skill from FabioYanezRomero/Knowledge-Graph-Builder. Adds a new LLM client provider to the clients module. Use when implementing support for a new LLM provider like Anthropic, OpenAI, Groq, or any OpenAI-compatible API.

Its SKILL.md is about 3.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with OpenAI. The repository describes itself as: Repository for building knowledge graphs from specific datasets using generative language model through ollama. The licence is MIT.

When your agent uses it

  • Implementing support for a new LLM provider like Anthropic
  • Any OpenAI-compatible API

Example prompts

  • “/add-llm-client”

Requirements

  • Python 3
  • A credential in GROQ_API_KEY

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Understand the Interface
  2. Create Provider Defaults
  3. Implement Your Client
  4. Register Client
  5. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 588f0d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.groq.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GROQ_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add LLM Client loads about 3.8k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 326 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from FabioYanezRomero/Knowledge-Graph-Builder at commit 588f0d9, republished under its MIT licence (© FabioYanezRomero). 326 words, ~3,760 tokens.

Download SKILL.mdSave it as .claude/skills/add-llm-client/SKILL.md (or your agent's skills folder).
name
add-llm-client
description
Adds a new LLM client provider to the clients module. Use when implementing support for a new LLM provider like Anthropic, OpenAI, Groq, or any OpenAI-compatible API.

Adding an LLM Client

This skill documents how to add a new LLM client provider to kgb/clients/.

Overview

LLM clients provide the interface between the extraction pipeline and language model APIs. The system provides:

  • Factory pattern with @client() decorator for auto-registration
  • Abstract base class (BaseLLMClient) with required methods
  • Configuration via ClientConfig dataclass
  • Provider defaults via JSON config files

Architecture

                          Clients Module
    ┌───────────────────────────────────────────────────────────┐
    │                                                           │
    │  base.py              config.py          factory.py       │
    │  ├─ BaseLLMClient     ├─ ClientConfig    ├─ ClientFactory │
    │  └─ LLMClientError    └─ ClientType      └─ @client()    │
    │                                                           │
    │  defaults.py                                              │
    │  └─ load_provider_defaults()  ← reads configs/*.json      │
    │                                                           │
    │  providers/                                               │
    │  ├─ gemini.py         ← Google Gemini (API-based)         │
    │  ├─ ollama.py         ← Ollama (local, OpenAI-compatible) │
    │  ├─ lmstudio.py       ← LM Studio (local, OpenAI-compat) │
    │  └─ your_provider.py  ← Your new client                  │
    │                                                           │
    │  configs/                                                 │
    │  ├─ gemini.json       ← Provider default values           │
    │  ├─ ollama.json                                           │
    │  ├─ lmstudio.json                                         │
    │  └─ your_provider.json                                    │
    │                                                           │
    └───────────────────────────────────────────────────────────┘

Registration Flow:
  @client("name") on class → ClientFactory.register() → ClientFactory.create(config)

Dependencies

ComponentLibraryPurpose
LLM frameworklangextract>=0.1Structured extraction with source grounding
OpenAI-compatibleopenai>=1.0API client for local servers
HTTPrequests>=2.28Direct API calls

ClientConfig Schema

python
@dataclass
class ClientConfig:
    client_type: ClientType = "gemini"      # str — no Literal constraint
    model_id: str | None = None             # None = use provider default
    temperature: float = 0.0
    max_workers: int | None = None
    max_char_buffer: int = 8000
    show_progress: bool = True
    extraction_passes: int = 1              # langextract passes
    batch_length: int | None = None         # langextract batch size
    api_key: str | None = None              # For API-based clients
    base_url: str | None = None             # For local server clients
    timeout: int = 120

Decision Tree

ScenarioPatternReference
OpenAI-compatible APIopenai SDK + langextractollama.py, lmstudio.py
Native SDKProvider's SDK + langextractgemini.py
REST API (augment)requests or openaiAll providers' augment()

Step 1: Understand the Interface

All clients must implement BaseLLMClient (defined in kgb/clients/base.py):

python
class BaseLLMClient(ABC):

    @abstractmethod
    def extract(
        self,
        text: str,
        prompt_description: str,
        examples: list[Any] | None = None,
        format_type: type | None = None,
        temperature: float | None = None,
        max_tokens: int | None = None,
        **kwargs: Any
    ) -> list[dict[str, Any]]:
        """Extract with source grounding (char positions via langextract)."""

    @abstractmethod
    def augment(
        self,
        text: str,
        prompt_description: str,
        format_type: type,
        temperature: float | None = None,
        max_tokens: int | None = None,
        **kwargs: Any
    ) -> list[dict[str, Any]]:
        """Generate inferred triples for graph augmentation.

        Unlike extract(), this does NOT ground in source text (no char positions).
        Used for high-level inference and bridging over an existing graph.
        """

    @classmethod
    @abstractmethod
    def from_config(cls, config: ClientConfig) -> BaseLLMClient:
        """Factory method to create client from configuration."""
extract() vs augment()
extract()augment()
PurposeExtract triples grounded in source textGenerate inferred bridging triples
Source groundingYes — char_start/char_end positionsNo — no position tracking
MechanismUses langextract's full pipelineDirect LLM call (no langextract)
Inference typeInferenceType.EXPLICITInferenceType.CONTEXTUAL
Called bybuilder/extraction.pybuilder/augmentation.py

Step 2: Create Provider Defaults

Create kgb/clients/configs/groq.json:

json
{
  "model_id": "llama-3.1-70b-versatile",
  "base_url": "https://api.groq.com/openai/v1",
  "max_workers": 10
}

These defaults are loaded by load_provider_defaults("groq") when no explicit value is provided.

Step 3: Implement Your Client

Create kgb/clients/providers/groq.py:

python
"""Groq cloud inference client."""

from __future__ import annotations

import json
from typing import TYPE_CHECKING, Any

import langextract as lx
from langextract.providers.openai import OpenAILanguageModel

from ..base import BaseLLMClient, LLMClientError
from ..defaults import load_provider_defaults
from ..factory import client

if TYPE_CHECKING:
    from ..config import ClientConfig


@client("groq")
class GroqClient(BaseLLMClient):
    """Client for Groq cloud inference."""

    def __init__(
        self,
        model_id: str = "llama-3.1-70b-versatile",
        api_key: str | None = None,
        base_url: str = "https://api.groq.com/openai/v1",
        max_workers: int = 10,
        max_char_buffer: int = 8000,
        show_progress: bool = True,
        timeout: int = 60,
        batch_length: int | None = None,
    ) -> None:
        import os

        self.model_id = model_id
        self.api_key = api_key or os.getenv("GROQ_API_KEY")
        self.base_url = base_url
        self.max_workers = max_workers
        self.max_char_buffer = max_char_buffer
        self.show_progress = show_progress
        self.timeout = timeout
        self.batch_length = batch_length

        if not self.api_key:
            raise LLMClientError("Groq API key required (set GROQ_API_KEY)")

    def extract(
        self,
        text: str,
        prompt_description: str,
        examples: list[Any] | None = None,
        format_type: type | None = None,
        temperature: float | None = None,
        max_tokens: int | None = None,
        **kwargs: Any
    ) -> list[dict[str, Any]]:
        """Extract with source grounding using langextract."""
        try:
            groq_model = OpenAILanguageModel(
                model_id=self.model_id,
                api_key=self.api_key,
                base_url=self.base_url,
                timeout=self.timeout
            )

            result = lx.extract(
                text_or_documents=text,
                prompt_description=prompt_description,
                examples=examples or [],
                model=groq_model,
                temperature=temperature or 0.0,
                max_workers=self.max_workers,
                max_char_buffer=self.max_char_buffer,
                show_progress=self.show_progress,
            )

            items = []
            if hasattr(result, 'extractions'):
                for extraction in result.extractions:
                    if extraction.attributes:
                        item = dict(extraction.attributes)
                        if extraction.char_interval:
                            item["char_start"] = extraction.char_interval.start_pos
                            item["char_end"] = extraction.char_interval.end_pos
                        items.append(item)

            return items

        except Exception as e:
            raise LLMClientError(f"Groq extraction failed: {e}") from e

    def augment(
        self,
        text: str,
        prompt_description: str,
        format_type: type,
        temperature: float | None = None,
        max_tokens: int | None = None,
        **kwargs: Any
    ) -> list[dict[str, Any]]:
        """Generate inferred triples without source grounding."""
        try:
            from openai import OpenAI

            oai = OpenAI(
                api_key=self.api_key,
                base_url=self.base_url,
                timeout=self.timeout
            )

            response = oai.chat.completions.create(
                model=self.model_id,
                messages=[
                    {"role": "system", "content": prompt_description},
                    {"role": "user", "content": text}
                ],
                temperature=temperature or 0.0,
                response_format={"type": "json_object"}
            )

            raw = response.choices[0].message.content
            data = json.loads(raw)

            # Handle both list and nested object responses
            if isinstance(data, list):
                return data
            # Search for a list value in the response
            for value in data.values():
                if isinstance(value, list):
                    return value
            return [data]

        except Exception as e:
            raise LLMClientError(f"Groq augmentation failed: {e}") from e

    @classmethod
    def from_config(cls, config: "ClientConfig") -> "GroqClient":
        defaults = load_provider_defaults("groq")
        return cls(
            model_id=config.model_id or defaults.get("model_id", "llama-3.1-70b-versatile"),
            api_key=config.api_key,
            base_url=config.base_url or defaults.get("base_url", "https://api.groq.com/openai/v1"),
            max_workers=config.max_workers or defaults.get("max_workers", 10),
            max_char_buffer=config.max_char_buffer,
            show_progress=config.show_progress,
            timeout=config.timeout,
            batch_length=config.batch_length or defaults.get("batch_length"),
        )

Step 4: Register Client

Import your provider in kgb/clients/providers/__init__.py:

python
from .gemini import GeminiClient
from .ollama import OllamaClient
from .lmstudio import LMStudioClient
from .groq import GroqClient  # Add this

__all__ = [
    "GeminiClient",
    "OllamaClient",
    "LMStudioClient",
    "GroqClient",  # Add this
]

The @client("groq") decorator on the class handles factory registration automatically when the module is imported.

Step 5: Verify

Check Registration
bash
python -c "from kgb.clients import ClientFactory; print(ClientFactory.get_available_clients())"
# Output: ['gemini', 'ollama', 'lmstudio', 'groq']
Unit Tests
python
import pytest
from unittest.mock import Mock, patch, MagicMock
from kgb.clients.providers.groq import GroqClient
from kgb.clients.base import LLMClientError


def test_client_from_config():
    from kgb.clients import ClientConfig

    config = ClientConfig(
        client_type="groq",
        model_id="mixtral-8x7b",
        api_key="test-key"
    )
    client = GroqClient.from_config(config)

    assert client.model_id == "mixtral-8x7b"
    assert client.api_key == "test-key"


def test_missing_api_key():
    with pytest.raises(LLMClientError, match="API key required"):
        GroqClient(api_key=None)


def test_factory_creates_groq():
    from kgb.clients import ClientFactory, ClientConfig

    config = ClientConfig(client_type="groq", api_key="test-key")
    client = ClientFactory.create(config)
    assert isinstance(client, GroqClient)


@patch('kgb.clients.providers.groq.OpenAI')
def test_augment_success(mock_openai):
    mock_client = MagicMock()
    mock_openai.return_value = mock_client
    mock_response = Mock(choices=[Mock(message=Mock(content='[{"head": "A", "relation": "r", "tail": "B"}]'))])
    mock_client.chat.completions.create.return_value = mock_response

    client = GroqClient(api_key="test")
    result = client.augment("text", "desc", dict)

    assert result == [{"head": "A", "relation": "r", "tail": "B"}]


@patch('kgb.clients.providers.groq.OpenAI')
def test_augment_error(mock_openai):
    mock_openai.return_value.chat.completions.create.side_effect = Exception("API error")

    client = GroqClient(api_key="test")
    with pytest.raises(LLMClientError, match="failed"):
        client.augment("text", "desc", dict)

Input/Output Examples

extract() — with char positions (source grounded)
python
client.extract(
    text="PharmaCorp developed X-123.",
    prompt_description="Extract relationships"
)
# Output:
[{"head": "PharmaCorp", "relation": "developed", "tail": "X-123",
  "char_start": 0, "char_end": 26}]
augment() — without char positions (inferred)
python
client.augment(
    text="<augmentation prompt with components>",
    prompt_description="Generate bridging triples to connect disconnected components",
    format_type=Triple
)
# Output:
[{"head": "Alice", "relation": "connected_to", "tail": "Acme",
  "inference": "contextual", "justification": "..."}]

CLI Usage

bash
kgb extract --input data.jsonl --domain legal --client groq
kgb extract --input data.jsonl --client groq --model mixtral-8x7b
kgb augment connectivity --input data.jsonl --domain legal --client groq

Key Principles

PrincipleImplementation
Exception Wrappingraise LLMClientError(...) from e
Lazy DependenciesImport SDKs inside methods
Provider DefaultsJSON file in configs/ + load_provider_defaults()
Registration@client("name") decorator auto-registers with factory

Files to Create/Modify

FileAction
kgb/clients/providers/groq.pyCreate — client implementation
kgb/clients/configs/groq.jsonCreate — provider defaults
kgb/clients/providers/__init__.pyModify — add import

Verification Checklist

  • Inherits from BaseLLMClient
  • Implements extract(), augment(), from_config()
  • Decorated with @client("name")
  • Provider defaults JSON in configs/
  • from_config() uses load_provider_defaults()
  • All errors wrapped in LLMClientError
  • Imported in kgb/clients/providers/__init__.py
  • augment() handles varied JSON response structures
  • Tests cover factory creation, defaults, errors

© FabioYanezRomero, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agent/skills/add-llm-client of FabioYanezRomero/Knowledge-Graph-Builder.

Open the folder on GitHubat commit 588f0d9

Compare with similar skills

Add LLM Client next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add LLM Client compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add LLM Client this skillFabioYanezRomero/Knowledge-Graph-Builder103—~3.8kAutomated safety check: PassMIT
Geo Fundamentalswasp-lang/wasp19k9 repos~861Automated safety check: PassMIT
AI SDKvercel-labs/ai-facts16820 repos~1.2kAutomated safety check: PassNone
AI Image Generation and Editingzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
PR Design DocOpenHands/OpenHands91k—~2.4kAutomated safety check: PassMIT
SEO GeoReScienceLab/opc-skills1.8k4 repos~2.1kAutomated safety check: PassApache-2.0

Similar skills

  • Geo Fundamentals

    wasp-lang/wasp

    Generative Engine Optimization for AI search engines (ChatGPT, Claude, Perplexity).

    19k GitHub starsUsed in 9 repos~861 tokens
    Marketing & SEOAuto-check passed
  • AI SDK

    vercel-labs/ai-facts

    Official

    Answer questions about the AI SDK and help build AI-powered features.

    168 GitHub starsUsed in 20 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

    47k GitHub stars~1.3k tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • PR Design Doc

    OpenHands/OpenHands

    For a non-trivial pull request, write a self-contained HTML design doc under the temporary .pr/ directory and link a visibility-appropriate preview in the PR description, so maintainers grasp the…

    91k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • SEO Geo

    ReScienceLab/opc-skills

    SEO & GEO (Generative Engine Optimization) for websites. An agent skill from ReScienceLab/opc-skills.

    1.8k GitHub starsUsed in 4 repos~2.1k tokens
    Marketing & SEOAuto-check passed
  • Open Code Review CLI

    alibaba/open-code-review

    Runs the ocr command-line tool to review Git changes, a commit or a branch comparison with an AI model, returning line-level comments and optionally applying fixes.

    46k GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from FabioYanezRomero/Knowledge-Graph-Builder

  • Add Augmentation Strategy

    FabioYanezRomero/Knowledge-Graph-Builder

    Adds a new iterative augmentation strategy (e.g., enrichment, summarization) to the builder module.

    103 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Add Converter

    FabioYanezRomero/Knowledge-Graph-Builder

    Adds a new output format converter (e.g., CSV, RDF) to the IO writers module.

    103 GitHub stars~2.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Add Dataset Format

    FabioYanezRomero/Knowledge-Graph-Builder

    Adds a new input format loader (e.g., Parquet, Excel) to the IO readers module.

    103 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Add Domain

    FabioYanezRomero/Knowledge-Graph-Builder

    Manage knowledge domains (e.g., Medical, Finance). An agent skill from FabioYanezRomero/Knowledge-Graph-Builder.

    103 GitHub stars~3.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Add Visualization

    FabioYanezRomero/Knowledge-Graph-Builder

    Adds a new visualization engine or style to the visualization module.

    103 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Add LLM Client

What does Add LLM Client do?

Adds a new LLM client provider to the clients module. An agent skill from FabioYanezRomero/Knowledge-Graph-Builder. Add LLM Client is an agent skill from FabioYanezRomero/Knowledge-Graph-Builder. Adds a new LLM client provider to the clients module.

When should I use Add LLM Client?

Add LLM Client fits situations like: implementing support for a new LLM provider like Anthropic; any OpenAI-compatible API.

How do I install Add LLM Client in Claude Code?

Run `npx skills add FabioYanezRomero/Knowledge-Graph-Builder --skill add-llm-client -a claude-code`. Or copy the skill folder (.agent/skills/add-llm-client in FabioYanezRomero/Knowledge-Graph-Builder) into .claude/skills/add-llm-client in your project. Claude Code loads it when a task matches its description.

How do I install Add LLM Client in Codex?

Run `npx skills add FabioYanezRomero/Knowledge-Graph-Builder --skill add-llm-client -a codex`. Or copy the skill folder (.agent/skills/add-llm-client in FabioYanezRomero/Knowledge-Graph-Builder) into .agents/skills/add-llm-client in your project. Codex loads it when a task matches its description.

Can I use Add LLM Client in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add FabioYanezRomero/Knowledge-Graph-Builder --skill add-llm-client -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-llm-client, .gemini/skills/add-llm-client, .github/skills/add-llm-client and .opencode/skills/add-llm-client in your project.

What does Add LLM Client need to run?

Going by SKILL.md and its folder, Add LLM Client needs the command-line tools its instructions call (python) and credentials named GROQ_API_KEY. Our summary lists: Python 3; A credential in GROQ_API_KEY.

Does Add LLM Client access the network?

SKILL.md names 1 domain. In commands or code: api.groq.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Add LLM Client safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add LLM Client use?

Add LLM Client is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add LLM Client use?

About 3.8k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add LLM Client?

Skills that share tags, products or a category with Add LLM Client: Geo Fundamentals (wasp-lang/wasp, 19k stars), AI SDK (vercel-labs/ai-facts, 168 stars), AI Image Generation and Editing (zhayujie/CowAgent, 47k stars) and PR Design Doc (OpenHands/OpenHands, 91k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add LLM Client?

FabioYanezRomero (a GitHub user) maintains it in FabioYanezRomero/Knowledge-Graph-Builder, which has 103 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on August 28, 2026.

Source: FabioYanezRomero/Knowledge-Graph-Builder on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.