Documentation Index
Fetch the complete documentation index at: https://docs.charmos.io/llms.txt
Use this file to discover all available pages before exploring further.
Custom Adapters
Charm is designed to be highly pluggable. While it ships with built-in adapters for LangChain, CrewAI, and OpenClaw, you can easily integrate any Python-based AI framework by building a Custom Adapter. Under the hood, Charm uses standard Pythonentry_points to dynamically discover and load adapters.
1. Create your Adapter Class
Your adapter must inherit fromcharm.adapters.base.BaseAdapter and implement the invoke method.
Create a file named my_adapter.py:
2. Register via Entry Points
To let Charm’s core loader find your adapter, register it in your package’spyproject.toml under the charm.adapters group.
For example, if you are publishing a package called charm-adapter-ag2:
pip install charm-adapter-ag2, the ag2 adapter immediately becomes available to the Charm CLI and Cloud Runner.
3. Use it in charm.yaml
Users can now reference your adapter in their charm.yaml file using the name you defined in the entry point (ag2):
4. Running in the Cloud Runner
If you want to run this custom adapter in the Charm Cloud Runner, you must pair it with a Custom Runtime (Base Image) that has your adapter package installed. Create aDockerfile:
charm.yaml:
type: ag2, dynamically load your adapter via the Python entry point, and execute the agent flawlessly.