pywayne-llm-chat-bot

pywayne-llm-chat-bot is a skill for Claude Code, Codex from wangyendt/wayne-skills. It costs 65 tokens per session (1,026 once invoked), scanned A, original, MIT.

A chat interface for language models through OpenAI-compatible APIs, including local servers such as Ollama. It supports one-off questions, streamed responses, conversation history, and multiple configurations.

In plain words
What is it for?
Use it to build Python chat applications, connect to hosted or local language-model servers, manage multi-turn sessions, and inspect or clear chat history.
Why use it?
It provides one Python interface for sending prompts and continuing conversations while retaining earlier messages. Streaming lets responses be processed as they arrive.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/wangyendt/wayne-skills/chat-bot
Any agent
npx skills add wangyendt/wayne-skills --skill chat-bot
Clone the repo
git clone --depth 1 https://github.com/wangyendt/wayne-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pywayne-llm-chat-bot

README.md
[![agentmods](https://agentmods.dev/badge/skills/wangyendt/wayne-skills/chat-bot.svg)](https://agentmods.dev/skills/wangyendt/wayne-skills/chat-bot)
Your own site
<a href="https://agentmods.dev/skills/wangyendt/wayne-skills/chat-bot"><img src="https://agentmods.dev/badge/skills/wangyendt/wayne-skills/chat-bot.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,026 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00065 $0.01026
Opus 5 $0.00032 $0.00513
Sonnet 5 $0.00013 $0.00205
Haiku 4.5 $0.00006 $0.00103

Measured 6d ago against content hash 3ef7e6f07878, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pywayne-llm-chat-bot scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

pywayne/llm/chat-bot/SKILL.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pywayne LLM Chat Bot

This module provides a synchronous LLM chat interface compatible with OpenAI APIs (including local servers like Ollama).

Quick Start

from pywayne.llm.chat_bot import LLMChat

# Create chat instance
chat = LLMChat(
    base_url="https://api.example.com/v1",
    api_key="your_api_key",
    model="deepseek-chat"
)

# Single-turn conversation (non-streaming)
response = chat.ask("Hello, LLM!", stream=False)
print(response)

# Streaming response
for token in chat.ask("Explain recursion", stream=True):
    print(token, end='', flush=True)

Multi-turn Conversation

# Use chat() for history tracking
for token in chat.chat("What is a class in Python?"):
    print(token, end='', flush=True)

# Continuation - remembers previous context
for token in chat.chat("How do I define a constructor?"):
    print(token, end='', flush=True)

# View history
for msg in chat.history:
    print(f"{msg['role']}: {msg['content']}")

# Clear history
chat.clear_history()

Configuration

LLMConfig Class

from pywayne.llm.chat_bot import LLMConfig

config = LLMConfig(
    base_url="https://api.example.com/v1",
    api_key="your_api_key",
    model="deepseek-chat",
    temperature=0.7,
    max_tokens=8192,
    top_p=1.0,
    frequency_penalty=0.0,
    presence_penalty=0.0,
    system_prompt="You are a helpful assistant"
)

chat = LLMChat(**config.to_dict())

Dynamic System Prompt Update

chat.update_system_prompt("You are now a Python expert, provide code examples")

Managing Multiple Sessions

from pywayne.llm.chat_bot import ChatManager

manager = ChatManager(
    base_url="https://api.example.com/v1",
    api_key="your_api_key",
    model="deepseek-chat",
    timeout=300  # Session timeout in seconds
)

# Get or create chat instance (maintains per-session history)
chat1 = manager.get_chat("user1")
chat2 = manager.get_chat("user2")

# Sessions are independent
chat1.chat("Hello from user1")
chat2.chat("Hello from user2")

# Remove a session
manager.remove_chat("user1")

Read the full file on GitHub · 149 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 149 lines · 65 tokens per session scan A 3ef7e6f07878

Subscribe to this mod's changes

pywayne-llm-chat-bot is a skill published in the GitHub repository wangyendt/wayne-skills (8 stars, last pushed 9d ago), licensed MIT. It adds 65 tokens to every session and 1,026 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

gemini-api-dev

Use this skill when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, streaming responses, background research tasks, function calling, structured output, or migrating from the old generateContent API. Covers SDK usage and best…

google-gemini/gemini-skills · 73 tokens

anthropic-claude-development

Expert guidance for Anthropic Claude API development including Messages API, tool use, prompt engineering, and building production applications with Claude models.

Mindrally/skills · 33 tokens

cloudflare-workers-ai

Cloudflare Workers AI for serverless GPU inference. Use for LLMs, text/image generation, embeddings, or encountering AIERROR, rate limits, token exceeded errors.

secondsky/claude-skills · 39 tokens

openrouter-ai-models-guide

Guide to OpenRouter — the unified API for 200+ AI models from OpenAI, Anthropic, Google, Meta, Mistral, and more. Covers model selection, pricing, routing strategies, fallback chains, and integration with SperaxOS for optimal model usage per task.

nirholas/three.ws · 64 tokens

LLM

Implement large language model (LLM) chat completions using the z-ai-web-dev-sdk. Use this skill when the user needs to build conversational AI applications, chatbots, AI assistants, or any text generation features. Supports multi-turn conversations, system prompts, and context management.

jjyaoao/HelloAgents · 59 tokens

laravel:ai-sdk

Build AI features with the first-party Laravel AI SDK (Laravel 13+); agents, embeddings, images, audio, and tool calling with provider-agnostic APIs.

jpcaparas/superpowers-laravel · 39 tokens