./sparrow.sh assistant --pipeline "fcall" --query "Exxon"

{
  "company": "ExxonMobil",
  "ticker": "XOM"
}
The stock price of the ExxonMobil is 113.48999786376953. USD
==================================================
Time to retrieve answer: 16.426633964991197

./sparrow.sh "{\"invoice_no\":\"int\", \"invoice_date\":\"str\", \"seller_name\":\"str\", \"seller_address\":\"str\",
\"seller_taxid\":\"str\", \"seller_iban\":\"str\", \"client_name\":\"str\", \"client_address\":\"str\",
\"client_taxid\":\"str\", \"invoice_items\":[{\"description\":\"str\", \"quantity\":\"float\", \"net_price\":\"float\",
\"net_worth\":\"float\", \"vat\":\"str\", \"gross_worth\":\"float\"}], \"invoice_summary\":[{\"net_worth\":\"float\", \"vat\":\"float\", \"gross_worth\":\"float\"}]}"
--pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Qwen2.5-VL-72B-Instruct-4bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/invoice_1.jpg"


./sparrow.sh "{\"invoice_no\":\"int\", \"invoice_date\":\"str\", \"seller_name\":\"str\", \"seller_address\":\"str\",
\"seller_taxid\":\"str\", \"seller_iban\":\"str\", \"client_name\":\"str\", \"client_address\":\"str\",
\"client_taxid\":\"str\", \"invoice_items\":[{\"description\":\"str\", \"quantity\":\"float\", \"net_price\":\"float\",
\"net_worth\":\"float\", \"vat\":\"str\", \"gross_worth\":\"float\"}], \"invoice_summary\":[{\"net_worth\":\"float\", \"vat\":\"float\", \"gross_worth\":\"float\"}]}"
--pipeline "sparrow-parse" --debug --options huggingface --options katanaml/sparrow-qwen2-vl-7b --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/invoice_1.jpg"


{
  "invoice_no": "61356291",
  "invoice_date": "09/06/2012",
  "seller_name": "Chapman, Kim and Green",
  "seller_address": "64731 James Branch, Smithmouth, NC 26872",
  "seller_taxid": "949-84-9105",
  "seller_iban": "GB50ACIE59715038217063",
  "client_name": "Rodriguez-Stevens",
  "client_address": "2280 Angela Plain, Hortonshire, MS 93248",
  "client_taxid": "939-98-8477",
  "invoice_items": [
    {
      "description": "Wine Glasses Goblets Pair Clear Glass",
      "quantity": 5.0,
      "net_price": 12.0,
      "net_worth": 60.0,
      "vat": "10%",
      "gross_worth": 66.0
    },
    {
      "description": "With Hooks Stemware Storage Multiple Uses Iron Wine Rack Hanging Glass",
      "quantity": 4.0,
      "net_price": 28.08,
      "net_worth": 112.32,
      "vat": "10%",
      "gross_worth": 123.55
    },
    {
      "description": "Replacement Corkscrew Parts Spiral Worm Wine Opener Bottle Houdini",
      "quantity": 1.0,
      "net_price": 7.5,
      "net_worth": 7.5,
      "vat": "10%",
      "gross_worth": 8.25
    },
    {
      "description": "HOME ESSENTIALS GRADIENT STEMLESS WINE GLASSES SET OF 4 20 FL OZ (591 ml) NEW",
      "quantity": 1.0,
      "net_price": 12.99,
      "net_worth": 12.99,
      "vat": "10%",
      "gross_worth": 14.29
    }
  ],
  "invoice_summary": [
    {
      "net_worth": 192.81,
      "vat": 19.28,
      "gross_worth": 212.09
    }
  ]
}
==================================================
Time to retrieve answer: 47.84319644900097


./sparrow.sh "[{\"instrument_name\":\"str\", \"valuation\":\"int\"}]" --pipeline "sparrow-parse" --debug --options mlx
--options mlx-community/Qwen2.5-VL-72B-Instruct-4bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bonds_table.png"


./sparrow.sh "[{\"instrument_name\":\"str\", \"valuation\":\"int\"}]" --pipeline "sparrow-parse" --debug --options huggingface
--options katanaml/sparrow-qwen2-vl-7b --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bonds_table.png"


[
  {
    "instrument_name": "UNITS BLACKROCK FIX INC DUB FDS PLC ISHS EUR INV GRD CP BD IDX/INST/E",
    "valuation": 19049
  },
  {
    "instrument_name": "UNITS ISHARES III PLC CORE EUR GOVT BOND UCITS ETF/EUR",
    "valuation": 83488
  },
  {
    "instrument_name": "UNITS ISHARES III PLC EUR CORP BOND 1-5YR UCITS ETF/EUR",
    "valuation": 213030
  },
  {
    "instrument_name": "UNIT ISHARES VI PLC/JP MORGAN USD E BOND EUR HED UCITS ETF DIST/HDGD/",
    "valuation": 32774
  },
  {
    "instrument_name": "UNITS XTRACKERS II SICAV/EUR HY CORP BOND UCITS ETF/-1D-/DISTR.",
    "valuation": 23643
  }
]
==================================================
Time to retrieve answer: 22.78700271800335


./sparrow.sh "*" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Qwen2.5-VL-72B-Instruct-4bit
--crop-size 60 --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/invoice_1.pdf"

{
  "invoice_number": "61356291",
  "date_of_issue": "09/06/2012",
  "seller": {
    "name": "Chapman, Kim and Green",
    "address": "64731 James Branch, Smithmouthouth, NC 26872",
    "tax_id": "949-84-9105",
    "iban": "GB50ACIE59715038217063"
  },
  "client": {
    "name": "Rodriguez-Stevens",
    "address": "2280 Angela Plain, Plain, MS 93248",
    "tax_id": "939-98-8477"
  },
  "items": [
    {
      "description": "Wine Glasses Goblets Pair Clear",
      "quantity": 5,
      "unit": "each",
      "net_price": 12.0,
      "net_worth": 60.0,
      "vat_percentage": 10,
      "gross_worth": 66.0
    },
    {
      "description": "With Hooks Stemware Storage Multiple Multiple Uses Iron Wine Rack Hanging",
      "quantity": 4,
      "unit": "each",
      "net_price": 28.08,
      "net_worth": 112.32,
      "vat_percentage": 10,
      "gross_worth": 123.55
    },
    {
      "description": "Replacement Corkscrew Parts Spiral Worm Worm Wine Opener Bottle Houdini",
      "quantity": 1,
      "unit": "each",
      "net_price": 7.5,
      "net_worth": 7.5,
      "vat_percentage": 10,
      "gross_worth": 8.25
    },
    {
      "description": "HOME ESSENTIALS GRADIENT STEMLESS WINE GLASSES SET OF 4 20 FL OZ (591 ml) NEW",
      "quantity": 1,
      "unit": "each",
      "net_price": 12.99,
      "net_worth": 12.99,
      "vat_percentage": 10,
      "gross_worth": 14.29
    }
  ],
  "summary": {
    "total_net_worth": 192.81,
    "total_vat": 19.28,
    "total_gross_worth": 212.09
  }
}
==================================================
Time to retrieve answer: 199.03000262507703


################ OLLAMA vs MLX-VLM TEST ##################

BONDS TABLE

./sparrow.sh "[{\"instrument_name\":\"str\", \"valuation\":\"int\"}]" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Qwen3-VL-30B-A3B-Instruct-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bonds_table.png"

mlx-community/Qwen3-VL-30B-A3B-Instruct-8bit - OK

./sparrow.sh "[{\"instrument_name\":\"str\", \"valuation\":\"int\"}]" --pipeline "sparrow-parse" --debug --options mlx --options lmstudio-community/Mistral-Small-3.2-24B-Instruct-2506-MLX-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bonds_table.png"

lmstudio-community/Mistral-Small-3.2-24B-Instruct-2506-MLX-8bit - OK

./sparrow.sh "[{\"instrument_name\":\"str\", \"quantity_nominal\": \"float\", \"ccy\": \"str\", \"closing_price\": \"float\", \"purchase_price\": \"float\", \"profit_loss_total\": \"str\", \"valuation\":\"int\", \"weighting\": \"str\"}]" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Ministral-3-14B-Instruct-2512-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bonds_table.png"

mlx-community/Ministral-3-14B-Instruct-2512-8bit - OK

Sparrow hints:

./sparrow.sh "[{\"instrument_name\":\"str\", \"valuation\":\"str\", \"profit_loss_pct\": \"str\", \"risk_category\": \"str\"}]" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/gemma-4-31b-it-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bonds_table.png" --hints-file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/llm_hints_eu.json"

mlx-community/gemma-4-31b-it-8bit - OK

./sparrow.sh "[{\"instrument_name\":\"str\", \"valuation\":\"str\", \"profit_loss_pct\": \"str\", \"risk_category\": \"str\"}]" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Qwen3.6-27B-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bonds_table.png" --hints-file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/llm_hints_eu.json"

mlx-community/Qwen3.6-27B-8bit - OK

./sparrow.sh "[{\"instrument_name\":\"str\", \"valuation\":\"str\", \"profit_loss_pct\": \"str\", \"risk_category\": \"str\"}]" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Ministral-3-14B-Instruct-2512-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bonds_table.png" --hints-file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/llm_hints_eu.json"

mlx-community/Ministral-3-14B-Instruct-2512-8bit - OK


Sparrow instructor calls:

QUERY="instruction: analyze bond portfolio and identify high risk positions based on loss percentage, return result as JSON with fields: instrument_short_name, loss_pct, risk_level (low/medium/high), payload: $(cat data/bonds_table.json)"

QUERY="instruction: analyze bond portfolio weighting and identify concentration risk, flag any position above 20% weighting as overweight, return JSON with fields: instrument_short_name, weighting, status, payload: $(cat data/bonds_table.json)"

QUERY="instruction: calculate total portfolio valuation in EUR and weighted average profit loss percentage, return JSON with fields: total_valuation_eur, weighted_avg_profit_loss_pct, best_performer, worst_performer, payload: $(cat data/bonds_table.json)"


./sparrow.sh "$QUERY" \
  --pipeline "sparrow-instructor" \
  --options mlx \
  --options mlx-community/gemma-4-31b-it-8bit



FINANCIAL STATEMENT

./sparrow.sh "[{\"description_text\":\"str\", \"price_1\":\"str or null\", \"price_2\": \"str or null\"}]" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Qwen3-VL-30B-A3B-Instruct-8bit --file-path "/Users/andrejb/Work/samples/tables/oracle_10k_2024_q1_small_table.png"

mlx-community/Qwen3-VL-30B-A3B-Instruct-8bit - FAIL

./sparrow.sh "[{\"description_text\":\"str\", \"price_1\":\"str or null\", \"price_2\": \"str or null\"}]" --pipeline "sparrow-parse" --debug --options mlx --options lmstudio-community/Mistral-Small-3.2-24B-Instruct-2506-MLX-8bit --file-path "/Users/andrejb/Work/samples/tables/oracle_10k_2024_q1_small_table.png"

lmstudio-community/Mistral-Small-3.2-24B-Instruct-2506-MLX-8bit - FAIL



INVOICE

./sparrow.sh "{\"invoice_no\":\"int\", \"invoice_date\":\"str\", \"seller_name\":\"str\", \"seller_address\":\"str\", \"seller_taxid\":\"str\", \"seller_iban\":\"str\", \"client_name\":\"str\", \"client_address\":\"str\", \"client_taxid\":\"str\", \"invoice_items\":[{\"description\":\"str\", \"quantity\":\"float\", \"net_price\":\"float\", \"net_worth\":\"float\", \"vat\":\"str\", \"gross_worth\":\"float\"}], \"invoice_summary\":[{\"net_worth\":\"float\", \"vat\":\"float\", \"gross_worth\":\"float\"}]}" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Qwen3-VL-30B-A3B-Instruct-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/invoice_1.jpg"

mlx-community/Qwen3-VL-30B-A3B-Instruct-8bit - OK

./sparrow.sh "{\"invoice_no\":\"int\", \"invoice_date\":\"str\", \"seller_name\":\"str\", \"seller_address\":\"str\", \"seller_taxid\":\"str\", \"seller_iban\":\"str\", \"client_name\":\"str\", \"client_address\":\"str\", \"client_taxid\":\"str\", \"invoice_items\":[{\"description\":\"str\", \"quantity\":\"float\", \"net_price\":\"float\", \"net_worth\":\"float\", \"vat\":\"str\", \"gross_worth\":\"float\"}], \"invoice_summary\":[{\"net_worth\":\"float\", \"vat\":\"float\", \"gross_worth\":\"float\"}]}" --pipeline "sparrow-parse" --debug --options mlx --options lmstudio-community/Mistral-Small-3.2-24B-Instruct-2506-MLX-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/invoice_1.jpg"

lmstudio-community/Mistral-Small-3.2-24B-Instruct-2506-MLX-8bit - OK

Improved table processing:

./sparrow.sh "{\"invoice_no\":\"int\", \"invoice_date\":\"str\", \"seller_name\":\"str\", \"seller_address\":\"str\", \"seller_taxid\":\"str\", \"seller_iban\":\"str\", \"client_name\":\"str\", \"client_address\":\"str\", \"client_taxid\":\"str\", \"items\":[{\"description\":\"str\", \"quantity\":\"float\", \"net_price\":\"float\", \"net_worth\":\"float\", \"vat\":\"str\", \"gross_worth\":\"float\"}]}" --pipeline "sparrow-parse" --table --table-template "sparrow_generic_table" --debug --options mlx --options mlx-community/Qwen3.6-35B-A3B-8bit --options mlx --options mlx-community/dots.ocr-bf16 --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/invoice_1.jpg"




BANK STATEMENT

./sparrow.sh "{\"account_number\":\"int\", \"statement_date\":\"str\", \"period_covered\":\"str\", \"total_money_in\":\"str\", \"total_money_out\":\"str\", \"statement_items\":[{\"date\":\"str\", \"description\":\"str\", \"withdrawal\":\"float or null\", \"deposit\":\"float or null\", \"balance\":\"float\"}]}" --pipeline "sparrow-parse" --debug --options mlx --options mlx-community/Qwen3-VL-30B-A3B-Instruct-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bank_statement.png"

mlx-community/Qwen3-VL-30B-A3B-Instruct-8bit - FAIL

./sparrow.sh "{\"account_number\":\"int\", \"statement_date\":\"str\", \"period_covered\":\"str\", \"total_money_in\":\"str\", \"total_money_out\":\"str\", \"statement_items\":[{\"date\":\"str\", \"description\":\"str\", \"withdrawal\":\"float or null\", \"deposit\":\"float or null\", \"balance\":\"float\"}]}" --pipeline "sparrow-parse" --debug --options mlx --options lmstudio-community/Mistral-Small-3.2-24B-Instruct-2506-MLX-8bit --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bank_statement.png"

lmstudio-community/Mistral-Small-3.2-24B-Instruct-2506-MLX-8bit - FAIL

Improved table processing:

./sparrow.sh "{\"account_number\":\"int\", \"statement_date\":\"str\", \"period_covered\":\"str\", \"total_money_in\":\"str\", \"total_money_out\":\"str\", \"items\":[{\"date\":\"str\", \"description\":\"str\", \"withdrawal\":\"float or null\", \"deposit\":\"float or null\", \"balance\":\"float\"}]}" --pipeline "sparrow-parse" --table --table-template "sparrow_generic_table" --debug --options mlx --options mlx-community/Qwen3.6-35B-A3B-8bit --options mlx --options mlx-community/dots.ocr-bf16 --file-path "/Users/andrejb/Work/katana-git/sparrow/sparrow-ml/llm/data/bank_statement.png"
