Views
No views yet
| Model Size | Model Name | Base Model | License | Huggingface Link |
|---|---|---|---|---|
| 2B | NuExtract-2.0-2B | Qwen2-VL-2B-Instruct | MIT | 🤗 NuExtract-2.0-2B |
| 2B | NuExtract-2.0-2B-GGUF | Qwen2-VL-2B-Instruct | MIT | 🤗 NuExtract-2.0-2B-GGUF |
| 4B | NuExtract-2.0-4B | Qwen2.5-VL-3B-Instruct | Qwen Research License | 🤗 NuExtract-2.0-4B |
| 4B | NuExtract-2.0-4B-GGUF | Qwen2.5-VL-3B-Instruct | Qwen Research License | 🤗 NuExtract-2.0-4B-GGUF |
| 8B | NuExtract-2.0-8B | Qwen2.5-VL-7B-Instruct | MIT | 🤗 NuExtract-2.0-8B |
| 8B | NuExtract-2.0-8B-GGUF | Qwen2.5-VL-7B-Instruct | MIT | 🤗 NuExtract-2.0-8B-GGUF |
NuExtract-2.0-2B is based on Qwen2-VL rather than Qwen2.5-VL because the smallest Qwen2.5-VL model (3B) has a more restrictive, non-commercial license. We therefore include NuExtract-2.0-2B as a small model option that can be used commercially.
verbatim-string - instructs the model to extract text that is present verbatim in the input.string - a generic string field that can incorporate paraphrasing/abstraction.integer - a whole number.number - a whole or decimal number.date-time - ISO formatted date.["string"])enum - a choice from set of possible answers (represented in template as an array of options, e.g. ["yes", "no", "maybe"]).multi-label - an enum that can have multiple possible answers (represented in template as a double-wrapped array, e.g. [["A", "B", "C"]]).null or [] (for arrays and multi-labels).1{
2 "first_name": "verbatim-string",
3 "last_name": "verbatim-string",
4 "description": "string",
5 "age": "integer",
6 "gpa": "number",
7 "birth_date": "date-time",
8 "nationality": ["France", "England", "Japan", "USA", "China"],
9 "languages_spoken": [["English", "French", "Japanese", "Mandarin", "Spanish"]]
10}1{
2 "first_name": "Susan",
3 "last_name": "Smith",
4 "description": "A student studying computer science.",
5 "age": 20,
6 "gpa": 3.7,
7 "birth_date": "2005-03-01",
8 "nationality": "England",
9 "languages_spoken": ["English", "French"]
10}1mkdir models
2hf download numind/NuExtract-2.0-4B-GGUF --local-dir ./modelsdocker run --gpus all -it -p 8000:8080 -v ./models:/models --entrypoint /app/llama-server ghcr.io/ggml-org/llama.cpp:full-cuda -m /models/NuExtract-2.0-4B-Q8_0.gguf --mmproj /models/mmproj-BF16.gguf --host 0.0.0.0docker run command above maps the port 8080 of the llama.cpp container to the port 8000 of the host.1import openai
2import json
3
4client = openai.OpenAI(
5 api_key="EMPTY",
6 base_url="http://localhost:8000",
7)chat_template_kwargs. Thus, the template has to be applied manually1flight_text = """Date: Tuesday March 25th 2025
2User info: Male, 32 yo
3
4Book me a flight this Saturday morning to go to Marrakesh and come back on April 5th. I want it to be business class. Air France if possible."""
5flight_template = """{
6 "Destination": "verbatim-string",
7 "Departure date range": {
8 "beginning": "date-time",
9 "end": "date-time"
10 },
11 "Return date range": {
12 "beginning": "date-time",
13 "end": "date-time"
14 },
15 "Requested Class": [
16 "1st",
17 "business",
18 "economy"
19 ],
20 "Preferred airlines": [
21 "string"
22 ]
23}"""
24
25response = client.chat.completions.create(
26 model="NuExtract",
27 temperature=0.0,
28 messages=[
29 {
30 "role": "user",
31 "content": [
32 {
33 "type": "text",
34 "text": f"# Template:\n{json.dumps(json.loads(flight_template), indent=4)}\n{flight_text}",
35 },
36 ],
37 },
38 ],
39)1identity_template = """{
2 "Last name": "verbatim-string",
3 "First names": [
4 "verbatim-string"
5 ],
6 "Document number": "verbatim-string",
7 "Date of birth": "date-time",
8 "Gender": [
9 "Male",
10 "Female",
11 "Other"
12 ],
13 "Expiration date": "date-time",
14 "Country ISO code": "string"
15}"""
16
17response = client.chat.completions.create(
18 model="NuExtract",
19 temperature=0.0,
20 messages=[
21 {
22 "role": "user",
23 "content": [
24 {
25 "type": "text",
26 "text": f"# Template:\n{json.dumps(json.loads(identity_template), indent=4)}\n<image>",
27 },
28 {
29 "type": "image_url",
30 "image_url": {
31 "url": f"https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Carte_identit%C3%A9_%C3%A9lectronique_fran%C3%A7aise_%282021%2C_recto%29.png/2880px-Carte_identit%C3%A9_%C3%A9lectronique_fran%C3%A7aise_%282021%2C_recto%29.png"
32 },
33 },
34 ],
35 },
36 ],
37)