local models support

+ fix some tests