No description
Migrate to the new model-boss v3 package with InferenceRouter architecture. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| packages/client | ||
| service | ||
| .gitignore | ||
| config.yaml | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
CoT Reasoning Service
Chain-of-Thought reasoning service with multi-stage pipeline orchestration.
Overview
This service provides configurable multi-stage reasoning pipelines for LLM-based analysis tasks. It abstracts the CoT pattern into a reusable service that can be consumed by other applications.
Architecture
cot-reasoning/
├── service/src/ # Python FastAPI service
│ ├── api/main.py # FastAPI endpoints
│ ├── config.py # Configuration (uses service-addresses)
│ ├── reasoning/ # CoT engine and stages
│ └── llm/ # LLM client adapter
├── packages/client/ # @lilith/cot-client TypeScript package
└── pyproject.toml # Python package definition
Port
Port 8110 is allocated in lilith-platform/infrastructure/ports.yaml under ml.cot-reasoning.
The service uses lilith-service-addresses for runtime port resolution.
Installation
Python Service
pip install cot-reasoning
TypeScript Client
npm install @lilith/cot-client
Usage
Python Service
# Start the service
python -m service
TypeScript Client
import { CoTClient } from '@lilith/cot-client';
// Auto-discovers port from service-addresses
const client = await CoTClient.create();
const result = await client.reason({
input: 'femboy, catgirl, lawyer',
stages: ['cultural_analysis'],
});
console.log(result.result);
console.log(result.reasoning_trace);
API Endpoints
POST /reason
Execute reasoning pipeline on input.
{
"input": "text to analyze",
"stages": ["stage1", "stage2"],
"context": {}
}
GET /stages
List available reasoning stages.
GET /health
Health check endpoint.
Dependencies
lilith-ml-service-base- FastAPI scaffoldinglilith-ollama-provider- LLM clientlilith-pipeline-framework- Pipeline orchestrationlilith-service-addresses- Port resolution
License
MIT