| Property |
Value
|
| sources |
litellm/skills/main.py
|
| domains |
Skills, Anthropic, CRUD, LiteLLM Proxy
|
| last_updated |
2026-02-15 16:00 GMT
|
Overview
The Skills API module provides CRUD operations for managing skills, with support for both Anthropic's native Skills API and a LiteLLM proxy-based storage backend, defaulting to Anthropic as the provider.
Description
This module implements four sync/async function pairs for skill management: create_skill/acreate_skill, list_skills/alist_skills, get_skill/aget_skill, and delete_skill/adelete_skill. All functions use the @client decorator and default to "anthropic" as the provider when none is specified. A key feature is dual routing: when custom_llm_provider="litellm_proxy", requests are routed to an internal LiteLLMSkillsTransformationHandler (lazily initialized via _get_litellm_skills_handler()) that stores skills in the LiteLLM database. For external providers like Anthropic, the module loads a BaseSkillsAPIConfig via ProviderConfigManager, validates the environment for API keys, transforms requests through the provider config, and dispatches HTTP calls via BaseLLMHTTPHandler. Skills can include uploaded files and must contain a SKILL.md file at the root.
Usage
Import this module when you need to create, list, retrieve, or delete skills. Skills are reusable capability definitions (typically file-based) that can be associated with Anthropic Claude models or stored in the LiteLLM proxy database.
Code Reference
Source Location
Signature
@client
def create_skill(
files: Optional[List[Any]] = None,
display_title: Optional[str] = None,
extra_headers: Optional[Dict[str, Any]] = None,
extra_query: Optional[Dict[str, Any]] = None,
extra_body: Optional[Dict[str, Any]] = None,
timeout: Optional[Union[float, httpx.Timeout]] = None,
custom_llm_provider: Optional[str] = None,
**kwargs,
) -> Union[Skill, Coroutine[Any, Any, Skill]]
@client
def list_skills(
limit: Optional[int] = None,
page: Optional[str] = None,
source: Optional[str] = None,
...,
) -> Union[ListSkillsResponse, Coroutine[Any, Any, ListSkillsResponse]]
@client
def get_skill(skill_id: str, ...) -> Union[Skill, Coroutine[Any, Any, Skill]]
@client
def delete_skill(skill_id: str, ...) -> Union[DeleteSkillResponse, Coroutine]
Import
from litellm.skills.main import (
create_skill, acreate_skill,
list_skills, alist_skills,
get_skill, aget_skill,
delete_skill, adelete_skill,
)
I/O Contract
Inputs
| Parameter |
Type |
Required |
Description
|
files |
Optional[List[Any]] |
For create |
Files for the skill (must include SKILL.md at root)
|
display_title |
Optional[str] |
No |
Display title for the skill
|
skill_id |
str |
For get/delete |
The ID of the skill to operate on
|
limit |
Optional[int] |
No |
Results per page (max 100, default 20)
|
page |
Optional[str] |
No |
Pagination token
|
source |
Optional[str] |
No |
Filter by source: "custom" or "anthropic"
|
custom_llm_provider |
Optional[str] |
No |
Provider; defaults to "anthropic", supports "litellm_proxy"
|
Outputs
| Function |
Return Type |
Description
|
create_skill |
Skill |
The created skill object
|
list_skills |
ListSkillsResponse |
Paginated list of skills
|
get_skill |
Skill |
The retrieved skill object
|
delete_skill |
DeleteSkillResponse |
Deletion confirmation
|
Usage Examples
import litellm
# Create a skill with Anthropic
skill = litellm.create_skill(
files=[("SKILL.md", b"# My Skill\nDoes something useful.")],
display_title="My Custom Skill",
custom_llm_provider="anthropic",
)
print(f"Skill ID: {skill['id']}")
import litellm
# List all skills
skills = litellm.list_skills(
limit=10,
source="custom",
custom_llm_provider="anthropic",
)
for skill in skills["data"]:
print(f"Skill: {skill['display_title']}")
import asyncio
import litellm
async def main():
# Use LiteLLM proxy storage
skill = await litellm.acreate_skill(
display_title="Proxy Skill",
custom_llm_provider="litellm_proxy",
)
print(skill)
asyncio.run(main())
Related Pages