diff --git a/lib/xml_schema_validator/Cargo.toml b/lib/xml_schema_validator/Cargo.toml
index 3013479..4cf4733 100644
--- a/lib/xml_schema_validator/Cargo.toml
+++ b/lib/xml_schema_validator/Cargo.toml
@@ -7,17 +7,14 @@ description = "XML Schema validation library optimized for llm token validation"
[lib]
name = "xml_schema_validator"
-# Required for PyO3
crate-type = ["cdylib", "rlib"]
[dependencies]
-# XML parsing utilities
+numpy = "0.24"
+pyo3 = { version = "0.24", features = ["extension-module"] }
quick-xml = { version = "0.28.1", features = ["serde", "serialize"] }
serde = { version = "1", features = ["derive"] }
-thiserror = "1.0.38" # Better error handling
-
-# Python bindings
-pyo3 = { version = "0.18.0", features = ["extension-module"] }
+thiserror = "1.0.38"
[build-dependencies]
xml_schema_generator = { version = "0.6.18", features = ["env_logger"] }
\ No newline at end of file
diff --git a/lib/xml_schema_validator/src/lib.rs b/lib/xml_schema_validator/src/lib.rs
index 8c39441..7af247e 100644
--- a/lib/xml_schema_validator/src/lib.rs
+++ b/lib/xml_schema_validator/src/lib.rs
@@ -4,6 +4,7 @@
//! A streaming XML validator that checks XML fragments against an XSD schema
mod error;
+mod logits_processor;
mod python;
mod schema;
mod token;
diff --git a/lib/xml_schema_validator/src/logits_processor.rs b/lib/xml_schema_validator/src/logits_processor.rs
new file mode 100644
index 0000000..7bf684c
--- /dev/null
+++ b/lib/xml_schema_validator/src/logits_processor.rs
@@ -0,0 +1,174 @@
+use pyo3::prelude::*;
+use pyo3::types::{PyDict, PyString};
+use pyo3::exceptions::PyValueError;
+use std::sync::RwLock;
+
+/// A minimal LogitsProcessor that enforces valid XML according to a schema.
+#[pyclass]
+pub struct XmlLogitsProcessor {
+ /// The Python tokenizer object
+ tokenizer: PyObject,
+ /// The schema text to validate against
+ schema_text: String,
+ /// The prompt length (for tracking generated vs. prompt tokens)
+ prompt_length: RwLock