Text Generation
Transformers
Safetensors
English
olmo3
tool-calling
function-calling
olmo
sentovara
conversational
Run this model with HF Jobs
Run Sentovara/Sentinel-7B-Tools on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Sentovara/Sentinel-7B-Tools. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Sentovara/Sentinel-7B-Tools on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Sentovara/Sentinel-7B-Tools. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Sentovara/Sentinel-7B-Tools. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Sentovara/Sentinel-7B-Tools with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sentovara/Sentinel-7B-Tools with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sentovara/Sentinel-7B-Tools") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Sentovara/Sentinel-7B-Tools") model = AutoModelForCausalLM.from_pretrained("Sentovara/Sentinel-7B-Tools", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sentovara/Sentinel-7B-Tools with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sentovara/Sentinel-7B-Tools" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sentovara/Sentinel-7B-Tools", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Sentovara/Sentinel-7B-Tools
- SGLang
How to use Sentovara/Sentinel-7B-Tools with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Sentovara/Sentinel-7B-Tools" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sentovara/Sentinel-7B-Tools", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Sentovara/Sentinel-7B-Tools" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sentovara/Sentinel-7B-Tools", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Sentovara/Sentinel-7B-Tools with Docker Model Runner:
docker model run hf.co/Sentovara/Sentinel-7B-Tools
Sentinel-7B-Tools v1
Browse filesFiles changed (15)
- README.mdAdded+87
- chat_template.jinjaAdded+16
- config.jsonAdded+75
- generation_config.jsonAdded+12
- model-00001-of-00003.safetensorsAdded+3
- model-00002-of-00003.safetensorsAdded+3
- model-00003-of-00003.safetensorsAdded+3
- model.safetensors.index.jsonAdded+363
- money_tools.pyAdded+90
- run.pyAdded+66
- sa5_tools.pyAdded+90
- tax_rates.jsonAdded+18
- tax_tools.pyAdded+96
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+13
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687---license: apache-2.0base_model: allenai/Olmo-3-7B-Instructlibrary_name: transformerspipeline_tag: text-generationtags:- tool-calling- function-calling- olmo- sentovaralanguage:- en---
# Sentinel-7B-Tools
**Sentinel-7B-Tools** is [allenai/Olmo-3-7B-Instruct](https://huggingface.co/allenai/Olmo-3-7B-Instruct) with Sentovara's tools add-on **folded into the weights**. It is one ordinary 7B model: no add-on to load, no router.
It learned two things:
1. **Hand exact jobs to small tools** instead of working them out in its head: a Sudoku solver, a calculator, date maths, Caesar / Base64 decoders, money maths (interest, loans, percentages, statistics) and UK tax (VAT, stamp duty, income tax, National Insurance, corporation tax, rates lookup). The tools are plain Python files in this repo (`sa5_tools.py`, `money_tools.py`, `tax_tools.py`, `tax_rates.json`); `run.py` wires them up.2. **Know when not to call a tool.** When the tools on offer don't fit the question, it just answers.
## Results: plain Olmo-3-7B-Instruct vs Sentinel-7B-Tools
Same questions, same settings (greedy, vLLM 0.31.0), both models scored by the same code. "Model + tool" rows mean the model called the tool and the tool produced the exact figure, which is how the model is meant to be used.
| Test | Plain Olmo-3-7B-Instruct | **Sentinel-7B-Tools** ||---|---|---|| Sudoku (model + tool), 300 | 72.7% | **97.3%** || Arithmetic (model + tool), 300 | 95.7% | **100%** || Dates (model + tool), 300 | 46.3% | **100%** || Codes - Caesar / Base64 (model + tool), 300 | 25.7% | **98.7%** || UK tax (model + tool), 300 | 82.7% | **100%** || Money maths (model + tool), 300 | 61.0% | **96.3%** || Chemistry questions, 300 | 22.0% | **32.7%** || Regex, 300 | 81.3% | **96.7%** || SQL, 300 | 63.3% | **66.0%** || Field extraction, 300 | 66.0% | **68.7%** || Intent, 400 | 40.8% | **41.2%** || **BFCL tool calling, overall** (3,472) | 73.2% | **75.8%** || BFCL simple | 86.2% | 88.0% || BFCL choosing between tools | 84.5% | 90.0% || BFCL several calls at once | 75.0% | 80.5% || BFCL several calls, several tools | 37.5% | 73.5% || BFCL real-user calls (live multiple) | 66.5% | 69.4% || BFCL knowing when NOT to call a tool | 92.5% | 90.8% || BFCL same, real-user questions | 80.0% | 75.1% || JSON schema bench (strict) | 70.4% | 73.1% || JSON, fresh schemas (strict) | 98.0% | 97.2% || Unit conversions, 300 | 39.7% | 37.3% |
All Sentinel-7B-Tools numbers are from the **merged** model itself (no add-on loaded), NVIDIA L40S. BFCL here is our run of the BFCL v3 single-turn categories (non-live + live) with Olmo-3's own tool format, not an official leaderboard entry.
**Where it is lower:** unit conversions (39.7% → 37.3%; it has no unit-conversion tool), "knowing when not to call a tool" on real-user questions (80.0% → 75.1%), and one small BFCL group, live parallel calls (7 → 6 of 16 questions). Everything else is level or up.
## How it was made
- **Base:** allenai/Olmo-3-7B-Instruct, revision `6e5971d9eba42665f5bd5a0fcf047f299ce1dccc` (Apache 2.0).- **Training:** LoRA (rank 16, alpha 32, learning rate 1e-4, 1 pass, loss on the final reply only), then merged into the weights with PEFT `merge_and_unload`.- **12,993 training examples:** - 10,000 tool-use conversations made by Sentovara's own scripts. The tool results and final figures come from the tools themselves; no other AI model wrote them. Split: 4,000 calculator / Sudoku / dates / codes, 3,000 money, 3,000 UK tax. - 2,993 "no tool needed" conversations: questions offered tools that don't fit, answered by the **plain Olmo-3-7B-Instruct in its own words** (answers that called a tool were thrown away). Questions come from [glaiveai/glaive-function-calling-v2](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2) (Apache 2.0; user questions paired with a different conversation's tools) and [databricks/databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k) (CC BY-SA 3.0). None overlaps a BFCL test question.- An earlier version trained on the 10,000 tool examples alone learned to call a tool for *every* question (BFCL "irrelevance" fell to 1.2%). The "no tool needed" examples fixed that; this is the fixed version.
## Usage
```bashpip install torch transformerspython run.py "How many days are there between 2024-03-01 and 2025-01-17?"```
```pythonfrom run import Sentinels = Sentinel() # loads Sentovara/Sentinel-7B-Toolsreply, calls = s.answer([{"role": "user", "content": "Stamp duty on a £425,000 house for a first-time buyer?"}])```
The model uses Olmo-3's own tool format: tools go in through the chat template (`tools=`), calls come back as `<function_calls>\nname(key=value, ...)\n</function_calls>`, and tool results go back as role `tool`. You can pass your own tools instead of the built-in ones.
## Limits
- UK tax figures use the rates in `tax_rates.json` (UK tax year 2026 to 2027, checked against GOV.UK on 28 Nov 2026); check them before relying on them.- The model is only as exact as its tools. Without `run.py` (or your own tool runner) the tool calls are just text.- It is a 7B model. Outside the tool jobs it behaves like the plain Olmo-3-7B-Instruct, with its strengths and weaknesses.
Made by [Sentovara](https://sentovara.com).12345678910111213141516{%- set has_system = messages|selectattr('role', 'equalto', 'system')|list|length > 0 -%}{%- if not has_system -%}{{- '<|im_start|>systemYou are a helpful function-calling AI assistant. ' -}}{%- if tools is none -%}{{- 'You do not currently have access to any functions. <functions></functions><|im_end|>' -}}{%- else -%}{{- 'You are provided with function signatures within <functions></functions> XML tags. You may call one or more functions to assist with the user query. Output any function calls within <function_calls></function_calls> XML tags. Do not make assumptions about what values to plug into functions.' -}}{{- '<functions>' -}}{{- tools | tojson -}}{{- '</functions><|im_end|>' -}}{%- endif -%}{%- endif -%}{%- for message in messages -%}{%- if message['role'] == 'system' -%}{{- '<|im_start|>system' + message['content'] -}}{%- if tools is not none -%}{{- '<functions>' -}}{{- tools | tojson -}}{{- '</functions>' -}}{%- elif message.get('functions', none) is not none -%}{{- ' <functions>' + message['functions'] + '</functions>' -}}{%- endif -%}{{- '<|im_end|>' -}}{%- elif message['role'] == 'user' -%}{{- '<|im_start|>user' + message['content'] + '<|im_end|>' -}}{%- elif message['role'] == 'assistant' -%}{{- '<|im_start|>assistant' -}}{%- if message.get('content', none) is not none -%}{{- message['content'] -}}{%- endif -%}{%- if message.get('function_calls', none) is not none -%}{{- '<function_calls>' + message['function_calls'] + '</function_calls>' -}}{% elif message.get('tool_calls', none) is not none %}{{- '<function_calls>' -}}{%- for tool_call in message['tool_calls'] %}{%- if tool_call is mapping and tool_call.get('function', none) is not none %}{%- set args = tool_call['function']['arguments'] -%}{%- set ns = namespace(arguments_list=[]) -%}{%- for key, value in args.items() -%}{%- set ns.arguments_list = ns.arguments_list + [key ~ '=' ~ (value | tojson)] -%}{%- endfor -%}{%- set arguments = ns.arguments_list | join(', ') -%}{{- tool_call['function']['name'] + '(' + arguments + ')' -}}{%- if not loop.last -%}{{ '' }}{%- endif -%}{% else %}{{- tool_call -}}{%- endif %}{%- endfor %}{{- '</function_calls>' -}}{%- endif -%}{%- if not loop.last -%}{{- '<|im_end|>' + '' -}}{%- else -%}{{- eos_token -}}{%- endif -%}{%- elif message['role'] == 'environment' -%}{{- '<|im_start|>environment' + message['content'] + '<|im_end|>' -}}{%- elif message['role'] == 'tool' -%}{{- '<|im_start|>environment' + message['content'] + '<|im_end|>' -}}{%- endif -%}{%- if loop.last and add_generation_prompt -%}{{- '<|im_start|>assistant' -}}{%- endif -%}{%- endfor -%}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475{ "architectures": [ "Olmo3ForCausalLM" ], "attention_bias": false, "attention_dropout": 0.0, "bos_token_id": null, "dtype": "bfloat16", "eos_token_id": 100257, "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "layer_types": [ "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention" ], "max_position_embeddings": 65536, "model_type": "olmo3", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "pad_token_id": 100277, "rms_norm_eps": 1e-06, "rope_parameters": { "full_attention": { "attention_factor": 1.2079441541679836, "beta_fast": 32.0, "beta_slow": 1.0, "factor": 8.0, "original_max_position_embeddings": 8192, "rope_theta": 500000, "rope_type": "yarn" }, "sliding_attention": { "rope_theta": 500000.0, "rope_type": "default" } }, "sliding_window": 4096, "tie_word_embeddings": false, "transformers_version": "5.22.1", "use_cache": false, "vocab_size": 100278}123456789101112{ "_from_model_config": true, "do_sample": true, "eos_token_id": [ 100265, 100257 ], "transformers_version": "4.57.1", "temperature": 0.6, "top_p": 0.95, "max_new_tokens": 32768}123version https://git-lfs.github.com/spec/v1oid sha256:9320ea99c307ce6d9b1d94ed221d531e282dee828ede585c7cea57bcf67b0e2fsize 4971407688123version https://git-lfs.github.com/spec/v1oid sha256:33f33567bc90376d7e8bcf96a64e6c2d5b4e2567a62629d336cdb433b5f4e816size 4947590320123version https://git-lfs.github.com/spec/v1oid sha256:f0234cd2371231c0228b6af34a09cfb1cef0e418be56ae45c60bee370cce70f4size 4677065648123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363{ "metadata": { "total_parameters": 7298011136, "total_size": 14596022272 }, "weight_map": { "lm_head.weight": "model-00001-of-00003.safetensors", "model.embed_tokens.weight": "model-00001-of-00003.safetensors", "model.layers.0.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00003.safetensors", "model.layers.0.mlp.up_proj.weight": "model-00001-of-00003.safetensors", "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.0.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.0.self_attn.k_norm.weight": "model-00001-of-00003.safetensors", "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00003.safetensors", "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00003.safetensors", "model.layers.0.self_attn.q_norm.weight": "model-00001-of-00003.safetensors", "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00003.safetensors", "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00003.safetensors", "model.layers.1.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00003.safetensors", "model.layers.1.mlp.up_proj.weight": "model-00001-of-00003.safetensors", "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.1.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.1.self_attn.k_norm.weight": "model-00001-of-00003.safetensors", "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00003.safetensors", "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00003.safetensors", "model.layers.1.self_attn.q_norm.weight": "model-00001-of-00003.safetensors", "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00003.safetensors", "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00003.safetensors", "model.layers.10.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.10.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.10.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.10.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.10.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.10.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.10.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.10.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.10.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.10.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.11.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.11.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.11.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.11.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.11.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.11.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.11.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.11.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.11.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.11.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.12.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.12.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.12.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.12.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.12.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.12.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.12.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.12.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.12.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.12.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.13.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.13.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.13.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.13.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.13.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.13.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.13.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.13.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.13.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.13.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.14.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.14.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.14.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.14.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.14.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.14.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.14.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.14.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.14.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.14.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.15.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.15.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.15.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.15.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.15.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.15.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.15.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.15.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.15.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.15.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.16.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.16.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.16.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.16.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.16.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.16.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.16.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.16.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.16.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.16.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.16.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.17.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.17.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.17.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.17.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.17.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.17.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.17.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.17.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.17.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.17.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.17.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.18.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.18.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.18.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.18.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.18.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.18.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.18.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.18.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.18.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.18.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.18.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.19.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.19.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.19.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.19.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.19.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.19.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.19.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.19.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.19.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.19.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.19.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.2.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00003.safetensors", "model.layers.2.mlp.up_proj.weight": "model-00001-of-00003.safetensors", "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.2.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.2.self_attn.k_norm.weight": "model-00001-of-00003.safetensors", "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00003.safetensors", "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00003.safetensors", "model.layers.2.self_attn.q_norm.weight": "model-00001-of-00003.safetensors", "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00003.safetensors", "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00003.safetensors", "model.layers.20.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.20.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.20.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.20.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.20.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.20.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.20.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.20.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.20.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.20.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.20.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.21.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.21.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.21.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.21.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.21.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.21.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.21.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.21.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.21.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.21.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.21.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.22.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.22.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.22.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.22.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.22.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.22.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.22.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.22.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.22.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.22.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.22.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.23.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.23.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.23.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.23.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.23.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.23.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.23.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.23.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.23.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.23.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.23.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.24.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.24.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.24.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.24.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.24.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.24.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.24.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.24.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.24.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.24.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.24.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.25.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.25.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.25.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.25.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.25.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.25.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.25.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.25.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.25.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.25.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.25.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.26.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.26.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.26.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.26.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.26.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.26.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.26.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.26.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.26.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.26.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.26.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.27.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.27.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.27.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.27.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.27.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.27.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.27.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.27.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.27.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.27.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.27.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.28.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.28.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.28.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.28.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.28.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.28.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.28.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.28.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.28.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.28.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.28.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.29.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.29.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.29.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.29.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.29.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.29.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.29.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.29.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.29.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.29.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.29.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.3.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00003.safetensors", "model.layers.3.mlp.up_proj.weight": "model-00001-of-00003.safetensors", "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.3.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.3.self_attn.k_norm.weight": "model-00001-of-00003.safetensors", "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00003.safetensors", "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00003.safetensors", "model.layers.3.self_attn.q_norm.weight": "model-00001-of-00003.safetensors", "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00003.safetensors", "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00003.safetensors", "model.layers.30.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.30.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.30.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.30.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.30.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.30.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.30.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.30.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.30.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.30.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.30.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.31.mlp.down_proj.weight": "model-00003-of-00003.safetensors", "model.layers.31.mlp.gate_proj.weight": "model-00003-of-00003.safetensors", "model.layers.31.mlp.up_proj.weight": "model-00003-of-00003.safetensors", "model.layers.31.post_attention_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.31.post_feedforward_layernorm.weight": "model-00003-of-00003.safetensors", "model.layers.31.self_attn.k_norm.weight": "model-00003-of-00003.safetensors", "model.layers.31.self_attn.k_proj.weight": "model-00003-of-00003.safetensors", "model.layers.31.self_attn.o_proj.weight": "model-00003-of-00003.safetensors", "model.layers.31.self_attn.q_norm.weight": "model-00003-of-00003.safetensors", "model.layers.31.self_attn.q_proj.weight": "model-00003-of-00003.safetensors", "model.layers.31.self_attn.v_proj.weight": "model-00003-of-00003.safetensors", "model.layers.4.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.4.mlp.gate_proj.weight": "model-00001-of-00003.safetensors", "model.layers.4.mlp.up_proj.weight": "model-00001-of-00003.safetensors", "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.4.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.4.self_attn.k_norm.weight": "model-00001-of-00003.safetensors", "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00003.safetensors", "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00003.safetensors", "model.layers.4.self_attn.q_norm.weight": "model-00001-of-00003.safetensors", "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00003.safetensors", "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00003.safetensors", "model.layers.5.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.5.mlp.gate_proj.weight": "model-00001-of-00003.safetensors", "model.layers.5.mlp.up_proj.weight": "model-00001-of-00003.safetensors", "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.5.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.5.self_attn.k_norm.weight": "model-00001-of-00003.safetensors", "model.layers.5.self_attn.k_proj.weight": "model-00001-of-00003.safetensors", "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00003.safetensors", "model.layers.5.self_attn.q_norm.weight": "model-00001-of-00003.safetensors", "model.layers.5.self_attn.q_proj.weight": "model-00001-of-00003.safetensors", "model.layers.5.self_attn.v_proj.weight": "model-00001-of-00003.safetensors", "model.layers.6.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.6.mlp.gate_proj.weight": "model-00001-of-00003.safetensors", "model.layers.6.mlp.up_proj.weight": "model-00001-of-00003.safetensors", "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.6.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.6.self_attn.k_norm.weight": "model-00001-of-00003.safetensors", "model.layers.6.self_attn.k_proj.weight": "model-00001-of-00003.safetensors", "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00003.safetensors", "model.layers.6.self_attn.q_norm.weight": "model-00001-of-00003.safetensors", "model.layers.6.self_attn.q_proj.weight": "model-00001-of-00003.safetensors", "model.layers.6.self_attn.v_proj.weight": "model-00001-of-00003.safetensors", "model.layers.7.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.7.mlp.gate_proj.weight": "model-00001-of-00003.safetensors", "model.layers.7.mlp.up_proj.weight": "model-00001-of-00003.safetensors", "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.7.post_feedforward_layernorm.weight": "model-00001-of-00003.safetensors", "model.layers.7.self_attn.k_norm.weight": "model-00001-of-00003.safetensors", "model.layers.7.self_attn.k_proj.weight": "model-00001-of-00003.safetensors", "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00003.safetensors", "model.layers.7.self_attn.q_norm.weight": "model-00001-of-00003.safetensors", "model.layers.7.self_attn.q_proj.weight": "model-00001-of-00003.safetensors", "model.layers.7.self_attn.v_proj.weight": "model-00001-of-00003.safetensors", "model.layers.8.mlp.down_proj.weight": "model-00001-of-00003.safetensors", "model.layers.8.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.8.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.8.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.8.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.8.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.8.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.8.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.8.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.8.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.8.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.layers.9.mlp.down_proj.weight": "model-00002-of-00003.safetensors", "model.layers.9.mlp.gate_proj.weight": "model-00002-of-00003.safetensors", "model.layers.9.mlp.up_proj.weight": "model-00002-of-00003.safetensors", "model.layers.9.post_attention_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.9.post_feedforward_layernorm.weight": "model-00002-of-00003.safetensors", "model.layers.9.self_attn.k_norm.weight": "model-00002-of-00003.safetensors", "model.layers.9.self_attn.k_proj.weight": "model-00002-of-00003.safetensors", "model.layers.9.self_attn.o_proj.weight": "model-00002-of-00003.safetensors", "model.layers.9.self_attn.q_norm.weight": "model-00002-of-00003.safetensors", "model.layers.9.self_attn.q_proj.weight": "model-00002-of-00003.safetensors", "model.layers.9.self_attn.v_proj.weight": "model-00002-of-00003.safetensors", "model.norm.weight": "model-00003-of-00003.safetensors" }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990"""SA-006 money-maths tools (owner 30 Nov 2026 13:33 UK "do 1 close this model and v3 pack"; numbers 13:35 "5000 300").Plain code the model calls; the sums are done here, never by the model. Interest, rate conversion, loans, savings,percentages, and basic statistics. Amounts are plain numbers (any currency); rates are percentages (5 means 5%)."""import math, statistics as st
def _n(x): if isinstance(x, (int, float)): return float(x) s = str(x).lower().replace("£", "").replace("$", "").replace("€", "").replace(",", "").replace("%", "").strip() mult = 1 if s.endswith("k"): mult, s = 1000, s[:-1] elif s.endswith("m"): mult, s = 1_000_000, s[:-1] return float(s) * multdef _m(x): return f"{x:,.2f}"def _list(x): if isinstance(x, (list, tuple)): return [_n(v) for v in x] return [_n(v) for v in str(x).replace(";", ",").replace(" ", ",").split(",") if v.strip()]FREQ = {"annually": 1, "yearly": 1, "semiannually": 2, "half-yearly": 2, "quarterly": 4, "monthly": 12, "weekly": 52, "daily": 365}def _f(x): if x is None: return 1 if isinstance(x, (int, float)): return int(x) s = str(x).lower().strip() return FREQ[s] if s in FREQ else int(float(s))
def compound_interest(principal, rate, years, compounding="annually", monthly_deposit=0): P, r, t, k, d = _n(principal), _n(rate) / 100, _n(years), _f(compounding), _n(monthly_deposit) fv = P * (1 + r / k) ** (k * t) dep = 0.0 if d: # deposits at the end of each month, growing at the same effective rate rm = (1 + r / k) ** (k / 12) - 1; n = round(12 * t) dep = d * n if rm == 0 else d * ((1 + rm) ** n - 1) / rm total = fv + dep; paid = P + d * round(12 * t) return f"Final value {_m(total)} after {t:g} years at {r*100:g}% compounded {k}x a year (paid in {_m(paid)}, interest earned {_m(total - paid)})"
def simple_interest(principal, rate, years): P, r, t = _n(principal), _n(rate) / 100, _n(years); i = P * r * t return f"Simple interest {_m(i)}; final value {_m(P + i)}"
def convert_rate(rate, given="nominal", compounding="monthly"): r, k = _n(rate) / 100, _f(compounding) if str(given).lower().startswith("nom"): e = (1 + r / k) ** k - 1; return f"Effective annual rate {e*100:.4f}% (from nominal {r*100:g}% compounded {k}x a year)" nom = k * ((1 + r) ** (1 / k) - 1); return f"Nominal rate {nom*100:.4f}% compounded {k}x a year (gives effective {r*100:g}%)"
def loan_payment(amount, rate, years, payments_per_year=12): P, r, t, k = _n(amount), _n(rate) / 100, _n(years), _f(payments_per_year) n = round(k * t); i = r / k pay = P / n if i == 0 else P * i / (1 - (1 + i) ** -n) return f"Payment {_m(pay)} per period ({n} payments); total paid {_m(pay * n)}, total interest {_m(pay * n - P)}"
def percentage(kind, a, b): a, b, k = _n(a), _n(b), str(kind).lower() if k == "of": return f"{a:g}% of {b:g} = {a * b / 100:.4f}".rstrip("0").rstrip(".") if k == "what_percent": return f"{a:g} is {a / b * 100:.4f}% of {b:g}" if k == "change": return f"Change from {a:g} to {b:g} = {(b - a) / a * 100:.4f}%" if k == "increase": return f"{a:g} increased by {b:g}% = {a * (1 + b / 100):.4f}" if k == "decrease": return f"{a:g} decreased by {b:g}% = {a * (1 - b / 100):.4f}" if k == "reverse": return f"Original value before a {b:g}% increase to {a:g} = {a / (1 + b / 100):.4f}" return "error: kind must be of, what_percent, change, increase, decrease, reverse"
def stats(numbers): x = _list(numbers) if len(x) < 2: return "error: give at least two numbers" return (f"n={len(x)}, mean {st.mean(x):.4f}, median {st.median(x):.4f}, sample standard deviation {st.stdev(x):.4f}, " f"population standard deviation {st.pstdev(x):.4f}, min {min(x):g}, max {max(x):g}, range {max(x) - min(x):g}")
def correlation(x, y): a, b = _list(x), _list(y) if len(a) != len(b) or len(a) < 3: return "error: x and y need the same length (at least 3)" return f"Pearson correlation r = {st.correlation(a, b):.4f} (n={len(a)})"
MONEY_TOOLS = [ {"type": "function", "function": {"name": "compound_interest", "description": "Grow savings or an investment with compound interest, optionally with a regular monthly deposit. rate is a yearly % (5 means 5%).", "parameters": {"type": "object", "properties": {"principal": {"type": "number"}, "rate": {"type": "number"}, "years": {"type": "number"}, "compounding": {"type": "string", "enum": ["annually", "semiannually", "quarterly", "monthly", "daily"]}, "monthly_deposit": {"type": "number"}}, "required": ["principal", "rate", "years"]}}}, {"type": "function", "function": {"name": "simple_interest", "description": "Simple (non-compound) interest on an amount.", "parameters": {"type": "object", "properties": {"principal": {"type": "number"}, "rate": {"type": "number"}, "years": {"type": "number"}}, "required": ["principal", "rate", "years"]}}}, {"type": "function", "function": {"name": "convert_rate", "description": "Convert between a nominal yearly rate and the effective annual rate (APR/AER). given: 'nominal' or 'effective'.", "parameters": {"type": "object", "properties": {"rate": {"type": "number"}, "given": {"type": "string", "enum": ["nominal", "effective"]}, "compounding": {"type": "string", "enum": ["annually", "semiannually", "quarterly", "monthly", "daily"]}}, "required": ["rate", "given", "compounding"]}}}, {"type": "function", "function": {"name": "loan_payment", "description": "Repayment on a loan or mortgage: payment per period, total paid and total interest.", "parameters": {"type": "object", "properties": {"amount": {"type": "number"}, "rate": {"type": "number"}, "years": {"type": "number"}, "payments_per_year": {"type": "integer"}}, "required": ["amount", "rate", "years"]}}}, {"type": "function", "function": {"name": "percentage", "description": "Percentages. kind: 'of' (a% of b), 'what_percent' (a is what % of b), 'change' (% change from a to b), 'increase'/'decrease' (a changed by b%), 'reverse' (original value before a b% increase that gave a).", "parameters": {"type": "object", "properties": {"kind": {"type": "string", "enum": ["of", "what_percent", "change", "increase", "decrease", "reverse"]}, "a": {"type": "number"}, "b": {"type": "number"}}, "required": ["kind", "a", "b"]}}}, {"type": "function", "function": {"name": "stats", "description": "Mean, median, standard deviation (sample and population), min, max and range of a list of numbers.", "parameters": {"type": "object", "properties": {"numbers": {"type": "array", "items": {"type": "number"}}}, "required": ["numbers"]}}}, {"type": "function", "function": {"name": "correlation", "description": "Pearson correlation between two lists of numbers of the same length.", "parameters": {"type": "object", "properties": {"x": {"type": "array", "items": {"type": "number"}}, "y": {"type": "array", "items": {"type": "number"}}}, "required": ["x", "y"]}}},]FUNCS = {"compound_interest": compound_interest, "simple_interest": simple_interest, "convert_rate": convert_rate, "loan_payment": loan_payment, "percentage": percentage, "stats": stats, "correlation": correlation}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566"""Sentinel-7B-Tools (Sentovara): answer one request, letting the model call its built-in tools and reading the results back.The model is allenai/Olmo-3-7B-Instruct with Sentovara's tools add-on folded into the weights (no add-on to load).Tools (all plain Python in this folder, no internet): Sudoku solver, calculator, date maths, Caesar / Base64 decoders(sa5_tools.py), money maths - interest, loans, percentages, statistics (money_tools.py), UK tax - VAT, stamp duty, income tax,National Insurance, corporation tax, rates lookup (tax_tools.py + tax_rates.json).Needs: torch, transformers (tested with 5.22.1). Usage: python run.py "How many days are there between 2024-03-01 and 2025-01-17?"You can also pass your own tools in Olmo's tool format; the model only calls a tool when one fits the question."""import ast, json, os, re, sysimport torchfrom transformers import AutoModelForCausalLM, AutoTokenizerHERE = os.path.dirname(os.path.abspath(__file__)); sys.path.insert(0, HERE)import sa5_tools, money_tools, tax_toolsMODEL = os.environ.get("SENTINEL_MODEL", "Sentovara/Sentinel-7B-Tools")ALL_TOOLS = sa5_tools.TOOLS + money_tools.MONEY_TOOLS + tax_tools.TAX_TOOLS
_STR = re.compile(r'"(?:\\.|[^"\\])*"')def _pyfy(s): # JSON literals -> Python literals, outside strings only parts, last = [], 0 fix = lambda x: re.sub(r"\btrue\b", "True", re.sub(r"\bfalse\b", "False", re.sub(r"\bnull\b", "None", x))) for m in _STR.finditer(s): parts.append(fix(s[last:m.start()])); parts.append(m.group(0)); last = m.end() parts.append(fix(s[last:])); return "".join(parts)def parse_calls(text): """Olmo-3 calls look like <function_calls>\nname(key=value, ...)\n</function_calls>, one call per line.""" out = [] for blk in re.findall(r"<function_calls>(.*?)</function_calls>", text, re.S): for line in [x.strip() for x in blk.strip().splitlines() if x.strip()]: try: node = ast.parse(_pyfy(line), mode="eval").body out.append({"name": node.func.id, "arguments": {k.arg: ast.literal_eval(k.value) for k in node.keywords}}) except Exception: out.append({"name": "<unparseable>", "arguments": {}}) return outdef run_tool(name, args): try: if name in tax_tools.FUNCS: return str(tax_tools.FUNCS[name](**args)) if name in money_tools.FUNCS: return str(money_tools.FUNCS[name](**args)) return str(sa5_tools.run(name, args)) except Exception as ex: return f"error: {ex}"
class Sentinel: def __init__(self, model=MODEL, device=None): self.device = device or ("cuda" if torch.cuda.is_available() else "cpu") self.tok = AutoTokenizer.from_pretrained(model) self.model = AutoModelForCausalLM.from_pretrained(model, dtype=torch.bfloat16 if self.device == "cuda" else torch.float32).to(self.device).eval() def _gen(self, msgs, tools, max_new_tokens): p = self.tok.apply_chat_template(msgs, tools=tools, tokenize=False, add_generation_prompt=True) ids = self.tok(p, return_tensors="pt", add_special_tokens=False).to(self.device) with torch.no_grad(): o = self.model.generate(**ids, max_new_tokens=max_new_tokens, do_sample=False) return self.tok.decode(o[0][ids["input_ids"].shape[1]:], skip_special_tokens=True).strip() def answer(self, messages, tools=None, max_new_tokens=1024): """messages: chat messages. tools: tool list (default: the built-in tools). Returns (reply, tool calls made).""" tools = ALL_TOOLS if tools is None else tools conv, calls = list(messages), [] for _ in range(3): # call tools, read results, answer (at most 3 rounds) t = self._gen(conv, tools, max_new_tokens); cs = parse_calls(t) if not cs: return t, calls conv.append({"role": "assistant", "content": t}); res = [] for c in cs: r = run_tool(c["name"], c["arguments"]); calls.append({**c, "result": r}); res.append(r) conv.append({"role": "tool", "content": "\n".join(res)}) # the chat template shows tool results as "environment" return t, calls
if __name__ == "__main__": q = " ".join(sys.argv[1:]) or "What day of the week was 2024-02-29?" reply, calls = Sentinel().answer([{"role": "user", "content": q}]) for c in calls: print(f"[tool] {c['name']}({json.dumps(c['arguments'])}) -> {c['result']}") print(reply)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990"""SA-005 tools (owner YES 26 Nov 2026 15:59 UK). Plain code the model can call; no learning inside them."""import base64, datetime as dt, json, re
TOOLS = [ {"type": "function", "function": {"name": "solve_sudoku", "description": "Solve a 9x9 Sudoku. Returns the completed grid as 9 lines of 9 digits.", "parameters": {"type": "object", "properties": {"grid": {"type": "string", "description": "The puzzle as 9 lines of 9 characters, digits for givens and '.' for empty cells."}}, "required": ["grid"]}}}, {"type": "function", "function": {"name": "calculate", "description": "Exact whole-number arithmetic on big numbers. Supports + - * / (exact integer division).", "parameters": {"type": "object", "properties": {"expression": {"type": "string", "description": "For example '3625701979503 - 361983218841'."}}, "required": ["expression"]}}}, {"type": "function", "function": {"name": "days_between", "description": "Number of days from one date to another.", "parameters": {"type": "object", "properties": {"start": {"type": "string", "description": "Date, e.g. '26 June 2002' or '2002-06-26'."}, "end": {"type": "string"}}, "required": ["start", "end"]}}}, {"type": "function", "function": {"name": "add_days", "description": "The date a number of days after a date (use a negative number for days before). Returns YYYY-MM-DD.", "parameters": {"type": "object", "properties": {"date": {"type": "string"}, "days": {"type": "integer"}}, "required": ["date", "days"]}}}, {"type": "function", "function": {"name": "weekday", "description": "The day of the week of a date, e.g. Monday.", "parameters": {"type": "object", "properties": {"date": {"type": "string"}}, "required": ["date"]}}}, {"type": "function", "function": {"name": "decode_caesar", "description": "Decode text that was encoded with a Caesar cipher by shifting each letter forward by 'shift'.", "parameters": {"type": "object", "properties": {"text": {"type": "string"}, "shift": {"type": "integer"}}, "required": ["text", "shift"]}}}, {"type": "function", "function": {"name": "decode_base64", "description": "Decode base64 text to plain text.", "parameters": {"type": "object", "properties": {"text": {"type": "string"}}, "required": ["text"]}}},]
def _date(s): s = str(s).strip().replace(",", "") for f in ("%Y-%m-%d", "%d %B %Y", "%d %b %Y", "%B %d %Y", "%d/%m/%Y"): try: return dt.datetime.strptime(s, f).date() except ValueError: pass raise ValueError(f"cannot read date {s!r}")
def _sudoku(grid): cells = [c for c in str(grid) if c in "0123456789."] if len(cells) != 81: raise ValueError("grid must have 81 cells") g = [0 if c in ".0" else int(c) for c in cells] def ok(i, v): r, c = divmod(i, 9) if any(g[r * 9 + j] == v for j in range(9)) or any(g[k * 9 + c] == v for k in range(9)): return False br, bc = r // 3 * 3, c // 3 * 3 return not any(g[(br + a) * 9 + bc + b] == v for a in range(3) for b in range(3)) def go(): best = None for i in range(81): if g[i] == 0: opts = [v for v in range(1, 10) if ok(i, v)] if best is None or len(opts) < len(best[1]): best = (i, opts) if not opts: return False if best is None: return True i, opts = best for v in opts: g[i] = v if go(): return True g[i] = 0; return False if not go(): raise ValueError("no solution") return "\n".join("".join(map(str, g[r * 9:r * 9 + 9])) for r in range(9))
def _calc(expr): e = str(expr).replace("×", "*").replace("÷", "/").replace("−", "-").replace(",", "").replace(" ", "") m = re.fullmatch(r"(-?\d+)([-+*/])(-?\d+)", e) if not m: raise ValueError("use: <number> <+|-|*|/> <number>") a, op, b = int(m.group(1)), m.group(2), int(m.group(3)) if op == "/": if b == 0: raise ValueError("division by zero") q, r = divmod(a, b); return str(q) if r == 0 else f"{q} remainder {r}" return str({"+": a + b, "-": a - b, "*": a * b}[op])
def _caesar(text, shift): k = int(shift) % 26 return "".join(chr((ord(c) - 97 - k) % 26 + 97) if c.islower() else chr((ord(c) - 65 - k) % 26 + 65) if c.isupper() else c for c in str(text))
def run(name, args): """Returns the tool result as a string (errors come back as 'error: ...' so the model can see them).""" try: a = args or {} if name == "solve_sudoku": return _sudoku(a["grid"]) if name == "calculate": return _calc(a["expression"]) if name == "days_between": return str((_date(a["end"]) - _date(a["start"])).days) if name == "add_days": return (_date(a["date"]) + dt.timedelta(days=int(a["days"]))).isoformat() if name == "weekday": return _date(a["date"]).strftime("%A") if name == "decode_caesar": return _caesar(a["text"], a["shift"]) if name == "decode_base64": return base64.b64decode(str(a["text"]).strip()).decode("utf-8", "replace") return f"error: unknown tool {name}" except Exception as ex: return f"error: {ex}"
def parse_calls(t): out = [] for b in re.findall(r"<tool_call>\s*(.*?)\s*</tool_call>", t, re.S): try: d = json.loads(b); a = d.get("arguments", {}) if isinstance(a, str): a = json.loads(a) out.append({"name": d["name"], "arguments": a}) except Exception: out.append({"name": "<unparseable>", "arguments": {}}) return out123456789101112131415161718{ "tax_year": "2026 to 2027 (6 April 2026 to 5 April 2027)", "checked": "28 Nov 2026, against GOV.UK; Autumn Budget 28 Oct 2026 left these main rates unchanged", "sources": ["https://www.gov.uk/income-tax-rates", "https://www.gov.uk/national-insurance/how-much-you-pay", "https://www.gov.uk/stamp-duty-land-tax/residential-property-rates", "https://www.gov.uk/government/publications/budget-2025-overview-of-tax-legislation-and-rates-ootlar/annex-a-rates-and-allowances"], "vat": {"standard": 0.20, "reduced": 0.05, "zero": 0.0, "registration_threshold": 90000, "deregistration_threshold": 88000}, "income_tax": {"region": "England, Wales and Northern Ireland (not Scotland)", "personal_allowance": 12570, "allowance_taper_start": 100000, "bands": [[37700, 0.20], [125140, 0.40], [null, 0.45]], "band_names": ["basic", "higher", "additional"]}, "national_insurance": {"employee": {"lower": 12570, "upper": 50270, "main_rate": 0.08, "upper_rate": 0.02}, "self_employed_class4": {"lower": 12570, "upper": 50270, "main_rate": 0.06, "upper_rate": 0.02}, "employer_rate": 0.15, "employer_threshold": 5000}, "stamp_duty": {"region": "England and Northern Ireland (Scotland has LBTT, Wales has LTT)", "standard": [[125000, 0.0], [250000, 0.02], [925000, 0.05], [1500000, 0.10], [null, 0.12]], "first_time": {"max_price": 500000, "bands": [[300000, 0.0], [500000, 0.05]]}, "additional_surcharge": 0.05, "additional_min_price": 40000, "non_resident_surcharge": 0.02}, "corporation_tax": {"small_profits_rate": 0.19, "main_rate": 0.25, "lower_limit": 50000, "upper_limit": 250000, "marginal_fraction": [3, 200]}, "dividends": {"allowance": 500, "ordinary": 0.1075, "upper": 0.3575, "additional": 0.3935}}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596"""SA-006 UK tax tools (owner YES 28 Nov 2026 20:14 UK). Plain code with the rates read from tax_rates.json, so a Budgetchange means editing that file, not retraining. Covers VAT, stamp duty (England & NI), income tax (not Scotland),National Insurance, corporation tax, and a rates lookup."""import json, osRATES = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "tax_rates.json")))def _m(x): return f"£{x:,.2f}"def _num(x): if isinstance(x, (int, float)): return float(x) s = str(x).lower().replace("£", "").replace(",", "").strip() mult = 1 if s.endswith("k"): mult, s = 1000, s[:-1] elif s.endswith("m"): mult, s = 1_000_000, s[:-1] return float(s) * multdef _slices(amount, bands, extra=0.0): out, lo, tot = [], 0.0, 0.0 for top, rate in bands: hi = amount if top is None else min(amount, top) if hi > lo: t = (hi - lo) * (rate + extra); tot += t; out.append(f"{rate + extra:.0%} on {_m(hi - lo)} = {_m(t)}") if top is None or amount <= top: break lo = top return tot, out
TAX_TOOLS = [ {"type": "function", "function": {"name": "vat", "description": "UK VAT on an amount. mode 'add' (amount is before VAT) or 'remove' (amount already includes VAT).", "parameters": {"type": "object", "properties": {"amount": {"type": "number"}, "mode": {"type": "string", "enum": ["add", "remove"]}, "rate": {"type": "string", "enum": ["standard", "reduced", "zero"]}}, "required": ["amount"]}}}, {"type": "function", "function": {"name": "stamp_duty", "description": "Stamp Duty Land Tax on a home in England or Northern Ireland.", "parameters": {"type": "object", "properties": {"price": {"type": "number"}, "buyer": {"type": "string", "enum": ["standard", "first_time", "additional"]}, "non_resident": {"type": "boolean"}}, "required": ["price"]}}}, {"type": "function", "function": {"name": "income_tax", "description": "UK income tax for a year (England, Wales, Northern Ireland) on total taxable income before the Personal Allowance.", "parameters": {"type": "object", "properties": {"income": {"type": "number"}}, "required": ["income"]}}}, {"type": "function", "function": {"name": "national_insurance", "description": "Yearly National Insurance: 'employee' (Class 1 on salary) or 'self_employed' (Class 4 on profits).", "parameters": {"type": "object", "properties": {"income": {"type": "number"}, "kind": {"type": "string", "enum": ["employee", "self_employed"]}}, "required": ["income"]}}}, {"type": "function", "function": {"name": "corporation_tax", "description": "UK corporation tax on a company's yearly taxable profit (includes marginal relief).", "parameters": {"type": "object", "properties": {"profit": {"type": "number"}}, "required": ["profit"]}}}, {"type": "function", "function": {"name": "tax_rates", "description": "Current UK rates and thresholds. topic: vat, income_tax, national_insurance, stamp_duty, corporation_tax, dividends, sole_trader_vs_limited.", "parameters": {"type": "object", "properties": {"topic": {"type": "string"}}, "required": ["topic"]}}},]
def vat(amount, mode="add", rate="standard"): a = _num(amount); r = RATES["vat"][rate or "standard"] if (mode or "add") == "remove": net = round(a / (1 + r), 2); v = round(a - net, 2) return f"VAT at {r:.0%} included in {_m(a)}: VAT {_m(v)}, price before VAT {_m(net)}" v = round(a * r, 2) return f"VAT at {r:.0%} on {_m(a)}: VAT {_m(v)}, total {_m(a + v)}"
def stamp_duty(price, buyer="standard", non_resident=False): p = _num(price); S = RATES["stamp_duty"]; buyer = buyer or "standard" extra = S["non_resident_surcharge"] if non_resident else 0.0 note = "" if buyer == "first_time" and p <= S["first_time"]["max_price"]: bands = S["first_time"]["bands"] + [[None, 0.0]] else: bands = S["standard"] if buyer == "first_time": note = " (first-time buyer relief does not apply over £500,000)" if buyer == "additional" and p >= S["additional_min_price"]: extra += S["additional_surcharge"] tot, parts = _slices(p, bands, extra) tot = float(int(tot + 1e-9)) # SDLT is rounded down to whole pounds return f"Stamp duty on {_m(p)} ({buyer.replace('_', ' ')} buyer{', non-UK resident' if non_resident else ''}){note}: total {_m(tot)}. " + "; ".join(parts)
def income_tax(income): i = _num(income); T = RATES["income_tax"] pa = max(0.0, T["personal_allowance"] - max(0.0, (i - T["allowance_taper_start"]) // 2)) taxable = max(0.0, i - pa); tot, parts = _slices(taxable, T["bands"]); tot = round(tot, 2) return f"Income tax on {_m(i)}: Personal Allowance {_m(pa)}, taxable {_m(taxable)}, total tax {_m(tot)}. " + "; ".join(parts)
def national_insurance(income, kind="employee"): i = _num(income); kind = kind or "employee"; N = RATES["national_insurance"]["employee" if kind == "employee" else "self_employed_class4"] main = max(0.0, min(i, N["upper"]) - N["lower"]) * N["main_rate"]; up = max(0.0, i - N["upper"]) * N["upper_rate"]; tot = round(main + up, 2) label = "Class 1 employee" if kind == "employee" else "Class 4 self-employed" return f"{label} National Insurance on {_m(i)}: total {_m(tot)} ({N['main_rate']:.0%} between {_m(N['lower'])} and {_m(N['upper'])} = {_m(main)}; {N['upper_rate']:.0%} above = {_m(up)})"
def corporation_tax(profit): p = _num(profit); C = RATES["corporation_tax"] if p <= C["lower_limit"]: tot = p * C["small_profits_rate"]; how = f"small profits rate {C['small_profits_rate']:.0%}" elif p >= C["upper_limit"]: tot = p * C["main_rate"]; how = f"main rate {C['main_rate']:.0%}" else: a, b = C["marginal_fraction"]; mr = (C["upper_limit"] - p) * a / b; tot = p * C["main_rate"] - mr how = f"main rate {C['main_rate']:.0%} ({_m(p * C['main_rate'])}) less marginal relief {_m(mr)}" return f"Corporation tax on profit of {_m(p)}: total {_m(round(tot, 2))} ({how})"
def tax_rates(topic): t = str(topic).lower().replace(" ", "_") R = RATES; y = R["tax_year"] if "vat" in t: v = R["vat"]; return f"VAT {y}: standard {v['standard']:.0%}, reduced {v['reduced']:.0%}, zero 0%. Must register when taxable turnover over any rolling 12 months goes over {_m(v['registration_threshold'])}; can deregister below {_m(v['deregistration_threshold'])}." if "income" in t: return f"Income tax {y} (England, Wales, NI): Personal Allowance £12,570 (reduced by £1 for every £2 over £100,000, gone at £125,140); basic 20% on the first £37,700 of taxable income, higher 40% up to £125,140, additional 45% above. Scotland has its own rates." if "national" in t or t == "ni": return f"National Insurance {y}: employees 8% on earnings £12,570 to £50,270 and 2% above; self-employed Class 4 6% on profits £12,570 to £50,270 and 2% above; employers 15% above £5,000." if "stamp" in t or "sdlt" in t: return f"Stamp duty {y} (England and NI): 0% to £125,000, 2% to £250,000, 5% to £925,000, 10% to £1.5m, 12% above. First-time buyers: 0% to £300,000, 5% to £500,000, no relief over £500,000. Additional homes +5% on every band; non-UK residents +2%. Scotland has LBTT and Wales has LTT." if "corp" in t: return f"Corporation tax {y}: 19% on profits up to £50,000, 25% over £250,000, marginal relief in between (fraction 3/200)." if "divid" in t: return f"Dividends {y}: £500 allowance, then 10.75% (basic), 35.75% (higher), 39.35% (additional)." if "sole" in t or "limited" in t or "ltd" in t: return (f"Sole trader vs limited company {y}: a sole trader pays income tax (20/40/45%) and Class 4 NI (6% then 2%) on profits. " "A limited company pays corporation tax (19% to 25%) on profits; owners then pay themselves salary (income tax + NI) and/or dividends (£500 allowance, then 10.75/35.75/39.35%). Companies have more admin and accounts to file.") return "error: topic must be one of vat, income_tax, national_insurance, stamp_duty, corporation_tax, dividends, sole_trader_vs_limited"
FUNCS = {"vat": vat, "stamp_duty": stamp_duty, "income_tax": income_tax, "national_insurance": national_insurance, "corporation_tax": corporation_tax, "tax_rates": tax_rates}12345678910111213{ "add_prefix_space": false, "backend": "tokenizers", "bos_token": "<|endoftext|>", "clean_up_tokenization_spaces": false, "eos_token": "<|endoftext|>", "is_local": true, "local_files_only": false, "model_max_length": 65536, "pad_token": "<|pad|>", "tokenizer_class": "TokenizersBackend", "unk_token": "<|endoftext|>"}README.mdAdded+87
chat_template.jinjaAdded+16
config.jsonAdded+75
generation_config.jsonAdded+12
model-00001-of-00003.safetensorsAdded+3
model-00002-of-00003.safetensorsAdded+3
model-00003-of-00003.safetensorsAdded+3
model.safetensors.index.jsonAdded+363
money_tools.pyAdded+90
run.pyAdded+66
sa5_tools.pyAdded+90
tax_rates.jsonAdded+18
tax_tools.pyAdded+96
tokenizer.jsonAdded
tokenizer_config.jsonAdded+13