No description
Find a file
Lilith 084a0b7ea0 fix(classifier): coerce dict reasoning to string in LLM responses
Fix validation error where LLM returns nested dict for "reasoning" field
instead of string. Add defensive coding to handle unexpected LLM response
formats and fix URL path duplication.

Changes:
- services/*/src/api/main.py: Coerce dict reasoning to JSON string
- services/*/src/config.py: Revert LLMConfig to BaseModel for proper
  env var merging in load_config()
- packages/cli/imajin: Fix LLM_SERVICE_URL to pass base URL only

Fixes:
- Validation error: "power_reasoning should be string, got dict"
- URL duplication: /v1/chat/completions/v1/chat/completions
- Add fallback reasoning for error cases

Note: Environment variable override for LLM_SERVICE_URL still needs
investigation - config may be cached before subprocess env vars are set.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 04:55:22 -08:00
docs feat(imajin): add main entry point service and client libraries 2026-01-10 05:15:36 -08:00
imajin feat(imajin): implement dynamic port allocation for isolated test execution 2026-01-12 04:41:20 -08:00
infrastructure fix(ports): 🐛 update port range for imajin services 2026-01-10 05:37:25 -08:00
node_modules feat(imajin-client): update version numbers in package files 2026-01-10 05:26:22 -08:00
orchestrators/imajin-pipeline feat(imajin-prompt): add http backend support for mistral-3 models 2026-01-10 21:50:17 -08:00
packages fix(classifier): coerce dict reasoning to string in LLM responses 2026-01-12 04:55:22 -08:00
scripts chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
services fix(classifier): coerce dict reasoning to string in LLM responses 2026-01-12 04:55:22 -08:00
tests feat(@ml/imajin/main): add initial implementation of ML model integration 2026-01-11 03:11:27 -08:00
tooling/claude feat(services/imajin-diffusion/service/tests/test_health.py, tooling/claude/CLAUDE.md): update health check and model layout endpoints 2026-01-10 07:45:34 -08:00
.npmrc chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
CLAUDE.md chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
package-lock.json feat(imajin-client): update version numbers in package files 2026-01-10 05:26:22 -08:00
package.json chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
pnpm-lock.yaml fix(node_modules/.bin/acorn): 🐛 resolve path issues in node_modules/.bin/acorn 2026-01-10 05:16:41 -08:00
README.md chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
run fix(run): 🐛 resolve missing venv path in orchestrator scripts 2026-01-11 01:29:05 -08:00

Imajin (Imagen Djinni)

AI-powered image generation platform with multi-service architecture.

Architecture

imajin/
├── services/                    # ML Services (GPU-accelerated)
│   ├── imajin-prompt/          # LLM prompt generation (Port 8003)
│   ├── imajin-diffusion/       # SDXL/Diffusers (Port 8002)
│   └── imajin-processing/      # CPU post-processing (Port 8004)
│
├── orchestrators/               # Composition Layer (no GPU)
│   └── imajin-pipeline/        # 7-stage pipeline (Port 8080)
│
├── packages/                    # Published Libraries (@lilith/imajin-*)
│   ├── imajin-app/             # Core configs & types
│   ├── imajin-react/           # React components
│   ├── imajin-electron/        # Desktop integration
│   └── imajin-client/          # Unified HTTP client
│
├── tests/                       # Integration tests
├── scripts/                     # Build & dev scripts
├── tooling/                     # Claude config
└── docs/                        # Documentation

ML Construction Kit Pattern

Services own ONE model type. Orchestrators compose services via HTTP.

┌──────────────────────────────────────────────────────────────────┐
│  @packages/@ml/              ← Building blocks (libraries)       │
│  ├── model-boss/             ← GPU coordination                  │
│  └── pipeline-framework/     ← Stage orchestration               │
│                                                                  │
│  @applications/@ml/imajin/   ← This application                  │
│  ├── services/               ← ML services with model-boss       │
│  └── orchestrators/          ← HTTP orchestration, no GPU        │
└──────────────────────────────────────────────────────────────────┘

Quick Start

# Install dependencies
npm install

# Build all packages
npm run build

# Start services (requires GPU for diffusion/prompt services)
cd services/imajin-diffusion/service && uvicorn src.api.main:app --port 8002
cd services/imajin-prompt/service && uvicorn src.api.main:app --port 8003
cd services/imajin-processing && npm run dev
cd orchestrators/imajin-pipeline && uvicorn src.image_pipeline.api.main:app --port 8080

Package Names

Package Description
@lilith/imajin-app Core configs, pipelines, prompts
@lilith/imajin-react React UI components
@lilith/imajin-electron Desktop integration
@lilith/imajin-client Unified HTTP client
@lilith/imajin-prompt-types Prompt service types
@lilith/imajin-prompt-client Prompt service client
@lilith/imajin-diffusion-types Diffusion service types
@lilith/imajin-diffusion-client Diffusion service client
@lilith/imajin-processing-types Processing service types
@lilith/imajin-processing-client Processing service client

Python Packages

Package Description
imajin-prompt-service LLM prompt generation (FastAPI)
imajin-diffusion-service SDXL image generation (FastAPI)
imajin-pipeline 7-stage orchestrator (FastAPI)

Port Assignments

Service Port
imajin-diffusion 8002
imajin-prompt 8003
imajin-processing 8004
imajin-pipeline 8080

License

MIT