langchain-chatchat
Route Langchain-Chatchat setup, RAG/API service, Python SDK, and LangChain adapter workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- langchain-chatchat
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route Langchain-Chatchat setup, RAG/API service, Python SDK, and LangChain adapter workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/package-overview.md3.9 KB
- 参考文档references/repo-provenance.md3.2 KB
- 参考文档references/repo-routing-metadata.json359 B
- 参考文档references/troubleshooting.md6.2 KB
03 SKILL.md 正文
Langchain-Chatchat Repo Skill
Use this skill when a task involves Langchain-Chatchat: installing or initializing the package, configuring model providers and knowledge bases, operating the FastAPI/WebUI service, calling the RAG/OpenAI-compatible APIs, or using the Python SDK and LangChain adapter objects.
Read references/repo-provenance.md before deciding whether this skill is current for a new checkout. Read references/package-overview.md for the package layout, distribution/import names, and high-level workflow map. Use references/troubleshooting.md for cross-cutting install/import/provider/service failures.
Quick orientation
Langchain-Chatchat is an offline-friendly RAG and Agent application that wraps LLM/embedding providers behind a Chatchat API server and WebUI. The selected core surfaces are:
langchain-chatchatdistribution, importingchatchatandlangchain_chatchat.chatchatCLI withinit,kb, andstartsubcommands.- FastAPI routes for chat, knowledge-base management, OpenAI-compatible
/v1/*, tools, server state, and MCP connection management. - A separate SDK import package spelled
open_chatcahtin this repository.
Minimal public install and import smoke:
python -m pip install -U langchain-chatchat
python - <<'PY'
import chatchat, langchain_chatchat
print(chatchat.__version__)
print(langchain_chatchat.__all__)
PY
chatchat --help
If the task uses the SDK package, verify the import spelling explicitly:
python - <<'PY'
import open_chatcaht
from open_chatcaht.chatchat_api import ChatChat
print(ChatChat)
PY
Route map
| User request shape | Read next |
|---|---|
Install, initialize data/config, pick CHATCHAT_ROOT, run chatchat init, rebuild KB files, start API/WebUI, Docker/Xinference deployment, model-provider setup |
sub-skills/server-setup-and-cli/SKILL.md |
Build or troubleshoot chat/RAG/API calls, /chat/chat/completions, /knowledge_base/*, tools, OpenAI-compatible /v1/*, vector stores, temp-file chat, search-engine RAG |
sub-skills/knowledge-base-and-api/SKILL.md |
Use the open_chatcaht SDK, ChatChat client, typed request models, streaming generators, ChatPlatformAI, PlatformToolsRunnable, MCP prompt utilities |
sub-skills/python-sdk-and-adapters/SKILL.md |
| Need a safe environment/package smoke from any current directory | Run scripts/chatchat_env_probe.py |
Standard operating sequence
- Decide installation mode: prefer
pip install -U langchain-chatchatfor users; use editable source installs only for repository development or when matching a specific checkout. - Set
CHATCHAT_ROOTto the persistent data/config directory if the current working directory is not the intended data root. - Run
chatchat initonce to create data directories, copy samples, initialize the metadata database, and generate YAML templates. - Edit model-provider and KB YAML settings before vector rebuild or service startup. Chatchat expects an OpenAI-compatible provider such as Xinference, Ollama, LocalAI, FastChat, One API, OpenAI, or a custom OpenAI endpoint.
- Run
chatchat kb -ronly after the embedding provider is reachable. Usechatchat kb --helpfor incremental/update/prune modes. - Start the service with
chatchat start --api,chatchat start --webui, orchatchat start -aafter provider and KB settings are valid. - For API/SDK tasks, confirm the API URL and model names before diagnosing request payloads.
Verification helpers
scripts/chatchat_env_probe.pychecks importability, optional package presence, CLI availability, and selected package metadata without starting a server.sub-skills/server-setup-and-cli/scripts/chatchat_config_audit.pyinspects an initializedCHATCHAT_ROOTfor expected YAML/data directories and key settings.sub-skills/knowledge-base-and-api/scripts/api_surface_probe.pylists FastAPI routes using a temp or initialized data root without binding a port.sub-skills/python-sdk-and-adapters/scripts/sdk_surface_probe.pylists SDK and adapter signatures without making HTTP calls.
Run each helper with --help first. None of these helpers downloads models, starts long-running services, calls external APIs, or mutates user data unless a documented option says it will create a temporary local root.
Boundaries and cautions
- Do not treat a CPU import as proof that a live LLM/embedding provider, Docker runtime, GPU model server, or external vector DB is working. Those are service/provider checks.
- Do not install Chatchat and a heavy model-serving framework into the same environment by default; the project documentation warns that model providers such as Xinference can conflict with the Chatchat environment.
- Do not run vector rebuilds, live chat tests, Docker Compose, or AutoDL-style scripts unless the user has approved model downloads/services, data mutation, and hardware use.
- Do not copy old command names from stale docs. Current CLI help exposes
chatchat init,chatchat kb, andchatchat start.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.