Agent skill
libllm
libllm - LLM API client for OpenAI-compatible endpoints. LlmApi class handles chat completions and embeddings via HTTP. Supports GitHub Models, Azure OpenAI, and standard OpenAI endpoints. Handles streaming responses, token counting, and multi-tool parallel call fixes. Use for LLM completions, embeddings, and AI model integration.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/libllm
SKILL.md
libllm Skill
When to Use
- Making chat completion requests to LLM providers
- Generating text embeddings for vector search
- Integrating with OpenAI-compatible APIs
- Handling streaming LLM responses
Key Concepts
LlmApi: HTTP client for OpenAI-compatible endpoints. Handles authentication, streaming, and response parsing.
DEFAULT_MAX_TOKENS: Standard token limit for completions.
Usage Patterns
Pattern 1: Chat completion
import { LlmApi } from "@copilot-ld/libllm";
const api = new LlmApi(config, logger);
const response = await api.completion([{ role: "user", content: "Hello" }], {
model: "gpt-4",
maxTokens: 1000,
});
Pattern 2: Generate embeddings
const embeddings = await api.embed(["text to embed"]);
// Returns array of vectors
Integration
Used by LLM service. Configurable via environment for different providers (OpenAI, Azure, GitHub Models).
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?