markitect-main/markitect/llm
tegwick 36c20f37d0 feat(llm): extract adapter layer for standalone llm-connect package (S1+S2)
Stage 1 — Decouple:
- Move RunConfig + LLMResponse to markitect/llm/models.py (canonical)
- Move LLMAdapter + Mock/ErrorLLMAdapter to markitect/llm/adapter.py
- markitect/prompts/execution/models.py and llm_adapter.py become re-export shims
- All 4 adapters + factory.py updated to import from markitect.llm.*
- Parameterize app_name in toml_config.py (resolve_llm, get_default_layers,
  get_preference_layers): paths and env var now derived from app_name arg
- Add tests/test_llm_isolation.py: 7 isolation + backward-compat tests

Stage 2 — Extract:
- Standalone llm-connect package created at ~/llm-connect/
- All 18 llm files copied; markitect.* imports replaced with llm_connect.*
- LLMError base inlined in llm_connect/exceptions.py (no markitect dep)
- llm-connect installed into markitect-venv; declared in pyproject.toml

Smoke test: markitect llm-check succeeds (live Gemini API call).
Backward compat: markitect.prompts.execution.{models,llm_adapter} still work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 08:04:50 +01:00
..
__init__.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00
_http.py fix(pipeline): retry on 0-entity response, save raw debug, improve template 2026-02-19 14:26:28 +01:00
_token_estimator.py feat(llm): add LLM integration module with OpenRouter and Claude Code adapters 2026-02-11 01:17:58 +01:00
adapter.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00
claude_code.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00
config.py feat(llm): add LLM integration module with OpenRouter and Claude Code adapters 2026-02-11 01:17:58 +01:00
embedding_adapter.py feat(llm): add embedding adapter with cache and similarity utils (S1.3) 2026-02-19 01:22:21 +01:00
embedding_cache.py feat(llm): add embedding adapter with cache and similarity utils (S1.3) 2026-02-19 01:22:21 +01:00
embedding_factory.py feat(llm): add embedding adapter with cache and similarity utils (S1.3) 2026-02-19 01:22:21 +01:00
embedding_openai.py feat(llm): add embedding adapter with cache and similarity utils (S1.3) 2026-02-19 01:22:21 +01:00
exceptions.py feat(llm): add LLM integration module with OpenRouter and Claude Code adapters 2026-02-11 01:17:58 +01:00
factory.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00
gemini.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00
models.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00
openai.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00
openrouter.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00
similarity.py feat(llm): add embedding adapter with cache and similarity utils (S1.3) 2026-02-19 01:22:21 +01:00
toml_config.py feat(llm): extract adapter layer for standalone llm-connect package (S1+S2) 2026-02-27 08:04:50 +01:00