executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
sdk-coreUse for direct LiteLLM Python SDK work: chat/text completions, async calls, streaming, embeddings, structured outputs, tools, token/cost checks, caching, callbacks, import/smoke validation, and shared SDK troubleshooting.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the task is about calling LiteLLM as a Python library. LiteLLM exposes OpenAI-format SDK calls across providers, with safe local validation available through mock_response and the bundled smoke script.
../proxy-server/SKILL.md for running or configuring the LiteLLM proxy server and CLI gateway.../routing/SKILL.md for Router, model groups, fallbacks, load balancing, and deployment selection.../providers-and-endpoints/SKILL.md for provider catalogs, endpoint-specific quirks, and pass-through APIs.../agent-tools/SKILL.md for MCP, A2A, and gateway-backed agent tool patterns.references/api-reference.md.references/workflows.md.references/troubleshooting.md.python sub-skills/sdk-core/scripts/sdk_smoke.py --checks import signature mock
Run the command from the generated skill root, or pass the script path directly from any working directory. It imports the installed litellm package and does not contact providers unless --provider-smoke is combined with --model and --api-key-env.
litellm.completion(...) is the main synchronous chat-completion API; litellm.acompletion(...) is the async equivalent.litellm.embedding(...) and litellm.aembedding(...) handle embeddings with provider-specific credentials and optional caching.litellm.text_completion(...) supports legacy prompt-style text completions when a provider/model still exposes that shape.model prefixes such as openai/..., anthropic/..., azure/..., bedrock/..., plus per-call api_key, base_url or api_base, api_version, and extra_headers when needed.mock_response, verbose logs, or a targeted live smoke call.import litellm
response = litellm.completion(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Say hello in one sentence."}],
temperature=0.2,
timeout=30,
)
print(response.choices[0].message.content)
stream = litellm.completion(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Count to three."}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
delta = chunk.choices[0].delta.content if chunk.choices else None
if delta:
print(delta, end="")
response = litellm.completion(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Return JSON with a color field."}],
response_format={"type": "json_object"},
mock_response='{"color":"blue"}',
)
python sub-skills/sdk-core/scripts/sdk_smoke.py --checks import.python sub-skills/sdk-core/scripts/sdk_smoke.py --checks signature.python sub-skills/sdk-core/scripts/sdk_smoke.py --checks mock.python sub-skills/sdk-core/scripts/sdk_smoke.py --provider-smoke --model openai/gpt-4o-mini --api-key-env OPENAI_API_KEY.mock_response for tests and diagnostics that should not spend provider credits.api_key from a secret manager.timeout explicit on production calls.litellm.callbacks, litellm.success_callback, litellm.failure_callback, or litellm.cache.