api-ai-ollama
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and OpenAI-compatible endpoint
npx skills add majiayu000/claude-skill-registry --skill api-ai-ollama --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Ollama Patterns > **Quick Guide:** Use the `ollama` npm package to run LLMs locally. Use `ollama.chat()` for conversations and `ollama.generate()` for single prompts. Enable streaming with `stream: true` and iterate with `for await`. Use `format` with a JSON schema (via `zodToJsonSchema`) for structured outputs. Use `tools` array for function calling. Use `ollama.embed()` for embeddings. Models run on your machine -- no API keys required for local use, but be aware of model loading time and memory usage. --- <critical_requirements> ## CRITICAL: Before Using This Skill > **All code must follow project conventions in CLAUDE.md** (kebab-case, named exports, import ordering, `import type`, named constants) **(You MUST use `ollama.chat()` for conversations and `ollama.generate()` for single-prompt completions -- they have different parameter shapes)** **(You MUST handle model loading delays -- the first request after a model is loaded takes significantly longer due to model initialization)** **(You MUST use `zodToJsonSchema()` from `zod-to-json-schema` for structured outputs -- do NOT manually construct JSON schemas)** **(You MUST accumulate streamed `thinking`, `content`, and `tool_c
- CRITICAL: Before Using This Skill
- Examples Index
- Philosophy
- Core Patterns
- Pattern 1: Client Setup
- Pattern 2: Chat Completions
- Pattern 3: Text Generation
- Pattern 4: Streaming
- Pattern 5: Structured Output with Zod
- Pattern 6: Tool Calling
- Pattern 7: Embeddings
- Pattern 8: Model Management
- Pattern 9: OpenAI-Compatible Endpoint
- Decision Framework
What does the api-ai-ollama skill do?
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and OpenAI-compatible endpoint
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-ai-ollama --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
