[package]
name = "finetype-train"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
description = "Training infrastructure for FineType — Sense, Entity, and Model2Vec training via Candle"
# Published as a dependency carrier: finetype-cli lists it as an optional dep
# (the `train` feature) and cargo requires every listed dep, optional or not,
# to exist on the registry. Internal support crate — no API stability promises.
readme = "README.md"

[dependencies]
# ML framework (Candle 0.8 + half pin for dependency resolution)
candle-core = { workspace = true }
candle-nn = { workspace = true }

# Serialization
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
safetensors = "0.4"

# Data loading
duckdb = { version = "=1.10503.1", default-features = true, features = ["bundled"] }
csv = { workspace = true }

# CLI
clap = { workspace = true }

# Utilities
anyhow = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
rand = { workspace = true }

# TUI dashboard
ratatui = { version = "0.29", optional = true }
crossterm = { version = "0.28", optional = true }

# Internal crates
finetype-core = { workspace = true }
finetype-model = { workspace = true }

[features]
default = ["tui"]
tui = ["dep:ratatui", "dep:crossterm"]
cuda = ["candle-core/cuda", "candle-nn/cuda"]
metal = ["candle-core/metal", "candle-nn/metal"]

[dev-dependencies]
tempfile = { workspace = true }

[[bin]]
name = "train-sense-model"
path = "src/bin/train_sense.rs"

[[bin]]
name = "train-entity-classifier"
path = "src/bin/train_entity.rs"

[[bin]]
name = "prepare-sense-data"
path = "src/bin/prepare_sense_data.rs"

[[bin]]
name = "prepare-model2vec"
path = "src/bin/prepare_model2vec.rs"

[[bin]]
name = "train-sibling-context"
path = "src/bin/train_sibling_context.rs"

[[bin]]
name = "tui-demo"
path = "src/bin/tui_demo.rs"

[lib]
name = "finetype_train"
path = "src/lib.rs"
