kosong
The LLM abstraction layer for modern AI agent applications.
Decision gist · record as of 2026-08-14
Yes, with conditions. Kosong is actively maintained and has low install friction, making it a solid choice for building multi-provider AI agents. However, the package is very new (first release 2025-10-15) and has no recorded license metadata—verify the license terms before using in proprietary work, and expect the API to evolve. If you need vendor-agnostic LLM abstraction and are comfortable with a young codebase, it's worth trying.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.12 or higher.
- API keys for at least one chat provider (Kimi, Anthropic, Google Gemini, or OpenAI) must be configured.
- Low install friction with a pure-Python wheel.
License · maintenance · safety
(unclear) — License treatment is unclear—no SPDX identifier or raw license text is recorded. Verify the actual license before using in proprietary or copyleft-sensitive projects.
last release 2026-08-03 (11 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 503,181 downloads/mo, #6,306 on PyPI
Alternatives
Verify before relying
import asyncio
import kosong
from kosong.chat_provider.kimi import Kimi
from kosong.message import Message
async def main():
kimi = Kimi(base_url="...", api_key="...", model="...")
history = [Message(role="user", content="Who are you?")]
result = await kosong.generate(chat_provider=kimi, system_prompt="...", tools=[], history=history)
print(result.message)
asyncio.run(main())- Whether the package is published under an open-source or proprietary license—no license metadata is recorded.
- Actual test coverage and stability guarantees given the very recent first release (2025-10-15).
- Whether streaming and tool-calling features are production-ready or still experimental.
What it is and what it does
Kosong is an LLM abstraction layer designed to unify how you interact with multiple large language model providers. It standardizes message structures, handles asynchronous tool orchestration, and lets you swap between providers (Kimi, Anthropic, Google Gemini, OpenAI) without rewriting your agent logic. The package is built on pydantic for schema validation, loguru for logging, and mcp for protocol support, and it exposes a simple async API for chat completion, streaming, and tool calling.
You use it by instantiating a chat provider, building a message history, and calling kosong.generate() or kosong.step() to get responses. Tool calling is handled through a pluggable toolset interface where you define tools as pydantic-based classes. This design avoids vendor lock-in and lets you experiment with different LLM backends without changing application code.
Use it for
- Build multi-provider AI agents that can switch between Kimi, Anthropic, Google Gemini, and OpenAI without code changes.
- Implement tool-calling workflows where the LLM orchestrates function execution asynchronously across a defined toolset.
- Stream LLM responses in real time while maintaining a unified message history and provider abstraction.
- Prototype and test agent behavior across different LLM backends to compare cost, latency, and output quality.
- Standardize message structures and chat logic across multiple projects using a single abstraction layer.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Kosong is actively maintained and has low install friction, making it a solid choice for building multi-provider AI agents. However, the package is very new (first release 2025-10-15) and has no recorded license metadata—verify the license terms before using in proprietary work, and expect the API to evolve. If you need vendor-agnostic LLM abstraction and are comfortable with a young codebase, it's worth trying.
Install
kosong on PyPI
Before you install
Low install friction with a pure-Python wheel. Active maintenance as of 11 days ago. Requires Python 3.12 or higher and brings in 9 runtime dependencies including anthropic, google-genai, openai, pydantic, and loguru.
Requires Python 3.12 or higher. API keys for at least one chat provider (Kimi, Anthropic, Google Gemini, or OpenAI) must be configured.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is recorded. Verify the actual license before using in proprietary or copyleft-sensitive projects.
Quickstart
import asyncio
import kosong
from kosong.chat_provider.kimi import Kimi
from kosong.message import Message
async def main():
kimi = Kimi(base_url="...", api_key="...", model="...")
history = [Message(role="user", content="Who are you?")]
result = await kosong.generate(chat_provider=kimi, system_prompt="...", tools=[], history=history)
print(result.message)
asyncio.run(main())
Verify before relying
- Whether the package is published under an open-source or proprietary license—no license metadata is recorded.
- Actual test coverage and stability guarantees given the very recent first release (2025-10-15).
- Whether streaming and tool-calling features are production-ready or still experimental.
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release >=3.12 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 9 packagesanthropicgoogle-genaijsonschemaloguruopenaipydanticpython-dotenvtyping-extensionsmcp |
| Maintenance | Actively maintained 11 days since the last release |
| First released | |
| Downloads | 503,181 / month, #6,306 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: kosong-0.56.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “llm abstraction layer”
- kosongKosong is an LLM abstraction layer that unifies message structures…
- chatlasChatlas provides a unified Python interface for building LLM chat…
- astra-assistantsWraps OpenAI's Assistants API as a drop-in replacement, adding…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also langchain-cli · litellm-enterprise · agent-framework-core · npmai-agents · chatlas · langgraph · livekit-plugins-sarvam · litellm-proxy-extras