Open cikkle opened 4 months ago
This probably needs more digging to figure out if it's a bug in the underlying library https://github.com/noamgat/lm-format-enforcer.
TabbyAPI doesn't actually do much here with the schema besides passing it to LMFE.
Are you supplying a
$schema
key as part of the schema? See here.
I'd left it out here but adding "$schema": "https://json-schema.org/draft/2020-12/schema"
doesn't appear to change anything.
It's entirely up to lmfe to parse the schema and constrain the token selection. There seems to be a related issue here, concluded by "prefixItems is works".. so, that's a little ambiguous. Either way it's an upstream issue and there isn't much that can be done about it on this end.
I sort of figured as much but I thought I'd start here. I've opened an issue with lmfe.
Describe the bug When using the JSON schema feature, the prefixItems keyword is not limiting the possible types of output from the model.
To Reproduce This is an example schema I tested:
On different attempts, I get back things like:
Expected behavior The output should follow the constraints of the prefixItems keyword in the schema, e.g.:
Logs Console output shows nothing unusual.
System info (Bugs without this information will go lower on our priority list!) Ubuntu 22.04.4 LTS Python 3.10.12 ROCm 6.1.1