mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
d28879208f
* Add multi-provider LLM adapter with model capability flags Introduce a provider abstraction layer between ChatSession and LLM SDK clients, enabling native support for Anthropic alongside OpenAI-compatible APIs. Each provider translates at the API boundary while the internal message format remains OpenAI-like throughout session history and persistence. - LLMProvider protocol with StreamChunk/CompletionResult normalized types - OpenAIProvider: GPT-4o, GPT-5.x, O-series capability tables with conditional temperature, reasoning_effort, and token param handling - AnthropicProvider: native streaming, message/tool format conversion, adaptive vs manual thinking modes, effort parameter for 4.6 models - ModelCapabilities per-model flags: temperature support, token param name, thinking mode, effort levels, context window, max output - Smart auto-detect: latest Opus for Anthropic, latest base GPT for OpenAI - --provider CLI flag for both turnstone and turnstone-server - anthropic SDK as optional dependency (pip install turnstone[anthropic]) - 56 new provider tests, 672 total passing - Updated architecture docs and 4 PlantUML diagrams * Fix Copilot PR #12 review: reasoning_effort gating, Anthropic thinking, provider factory - Default reasoning_effort_values to () so unknown/local models don't receive unsupported top-level reasoning_effort param. Models that need it (GPT-5.x, search models) have explicit capability declarations. - Fix Anthropic _reasoning_params: "none" and "" effort now return {} instead of enabling thinking with 4096 budget. - Use create_provider("openai") singleton instead of OpenAIProvider() in ChatSession fallback for consistency with registry path. - Add 8 parameter gating tests: unknown model no reasoning_effort, GPT-5 no temperature, GPT-5.1 conditional temperature, O-series no temperature, Anthropic none/empty/low effort.
127 lines
3.2 KiB
TOML
127 lines
3.2 KiB
TOML
[build-system]
|
|
requires = ["hatchling>=1.29"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "turnstone"
|
|
version = "0.3.0"
|
|
description = "Multi-node AI orchestration platform with tool use, agent routing, and cluster simulation."
|
|
readme = "README.md"
|
|
license = "BUSL-1.1"
|
|
requires-python = ">=3.11"
|
|
authors = [{name = "Patrick Buckley", email = "buckleypm@gmail.com"}]
|
|
keywords = ["ai", "chat", "llm", "agent", "tools", "openai"]
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"Environment :: Console",
|
|
"Intended Audience :: Developers",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
]
|
|
dependencies = [
|
|
"openai>=2.24",
|
|
"httpx>=0.28",
|
|
"mcp>=1.6",
|
|
"starlette>=0.45",
|
|
"uvicorn>=0.34",
|
|
"sse-starlette>=2.0",
|
|
"httpx-sse>=0.4",
|
|
]
|
|
|
|
[project.urls]
|
|
Homepage = "https://github.com/turnstonelabs/turnstone"
|
|
Repository = "https://github.com/turnstonelabs/turnstone"
|
|
Issues = "https://github.com/turnstonelabs/turnstone/issues"
|
|
|
|
[project.optional-dependencies]
|
|
test = ["pytest>=9.0", "pytest-cov>=6.0"]
|
|
dev = ["ruff>=0.9", "mypy>=1.14", "types-redis>=4.6"]
|
|
mq = ["redis>=7.2"]
|
|
console = ["redis>=7.2"]
|
|
sim = ["redis>=7.2"]
|
|
anthropic = ["anthropic>=0.39"]
|
|
|
|
|
|
[project.scripts]
|
|
turnstone = "turnstone.cli:main"
|
|
turnstone-eval = "turnstone.eval:main"
|
|
turnstone-server = "turnstone.server:main"
|
|
turnstone-bridge = "turnstone.mq.bridge:main"
|
|
turnstone-console = "turnstone.console.server:main"
|
|
turnstone-sim = "turnstone.sim.cli:main"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
include = [
|
|
"turnstone/**/*.py",
|
|
"turnstone/tools/*.json",
|
|
"turnstone/ui/static/*.html",
|
|
"turnstone/ui/static/*.css",
|
|
"turnstone/ui/static/*.js",
|
|
"turnstone/console/static/*.html",
|
|
"turnstone/console/static/*.css",
|
|
"turnstone/console/static/*.js",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
markers = ["live: requires a running LLM backend"]
|
|
|
|
[tool.ruff]
|
|
target-version = "py311"
|
|
line-length = 100
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "W", "I", "N", "UP", "B", "A", "SIM", "TCH"]
|
|
ignore = ["E501"]
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "double"
|
|
|
|
[tool.mypy]
|
|
python_version = "3.11"
|
|
strict = true
|
|
warn_return_any = true
|
|
warn_unused_configs = true
|
|
disallow_untyped_defs = true
|
|
disallow_incomplete_defs = true
|
|
check_untyped_defs = true
|
|
no_implicit_optional = true
|
|
|
|
[tool.coverage.run]
|
|
source = ["turnstone"]
|
|
branch = true
|
|
omit = ["turnstone/*/static/*"]
|
|
|
|
[tool.coverage.report]
|
|
show_missing = true
|
|
skip_empty = true
|
|
exclude_lines = [
|
|
"pragma: no cover",
|
|
"if TYPE_CHECKING",
|
|
"raise NotImplementedError",
|
|
'if __name__ == "__main__"',
|
|
]
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = ["sympy", "sympy.*", "numpy", "numpy.*"]
|
|
ignore_missing_imports = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = ["mcp", "mcp.*"]
|
|
ignore_missing_imports = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = ["sse_starlette", "sse_starlette.*", "uvicorn", "uvicorn.*", "httpx_sse", "httpx_sse.*"]
|
|
ignore_missing_imports = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = ["anthropic", "anthropic.*"]
|
|
ignore_missing_imports = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "tests.*"
|
|
disallow_untyped_defs = false
|