Model Name:usmankhanic/apexe3-dec-enc-fn-v0011 Architecture: T5-small (encoder-decoder) Purpose: Convert natural language queries into a structured function call format with parameters—especially tuned for capital markets applications that demand private, agentic solutions.
Overview
The APEX-E3 Dec-Enc Function-Call Model (v0.011) is a fine-tuned T5-small model specialised in generating function call structures from plain English queries. Rather than producing unstructured text, this model outputs instructions for specific function calls, including all relevant parameters.
With a special focus on capital market use cases, it was trained on queries that map directly to functions like selectStocks, run_backtest, and optimizer, ensuring precise extraction of parameters needed for advanced trading, backtesting, and portfolio optimization workflows.
This solution is lightweight, highly performant, and—thanks to our novel training approach—extraordinarily easy to re-train or adapt to new function definitions and parameter sets.
Key Features
Laser-Focused on Capital Markets
Model is pre-trained and fine-tuned to parse finance- and trading-centric instructions.
Produces direct calls to your functions with minimal overhead.
Private & Agentic
Ideal for organisations seeking on-premises or private cloud solutions where data control and agentic autonomy are paramount.
Ultra-Easy Training Approach
Using a simple Python/Flask app and structured JSON, you can re-train or extend the model on your own custom function definitions in minutes, no large-scale ML infrastructure required.
Ingestion of minimal training data is enough to achieve high accuracy in mapping user queries to structured parameters.
Lightweight, Fast Inference
Based on T5-small (~60M parameters), balancing performance with rapid inference, even in CPU-only setups.
Perfect for real-time or near-real-time decision-making in capital markets.
Fine-Tuning: Customised data mapping natural language to function calls, specifically in capital markets contexts.
Parameter Count: ~60M
Tokenizer: T5 SentencePiece tokenizer
Training Objective
To convert input prompts like:
"Your job is to pick the correct function name and produce key=value lines.
Query: <USER_QUERY>
Format:
function_name=<NAME>
param1=value
param2=value
...
"
into structured output with the correct function name (e.g., selectStocks, run_backtest, or optimizer) and the corresponding parameters (from=, to=, sector=, etc.).
Intended Use Cases
This model was specifically trained to parse user requests and map them onto the following function signatures:
This structured output is ready for an internal function selectStocks(...).
run_backtest
User Query: “Run a backtest on asset AAPL from 2020 to 2022 with a simple buy condition of RSI<30 and sell condition of RSI>70, starting capital 100000, fees 0.1%.”
These examples showcase how the model turns free-form text into direct function invocations.
Innovative Training Approach
Single JSON File → Fine-Tuned Model
With a minimal data set in JSON specifying (query_text, correct_function_name, correct_params), the included script fine-tunes T5-small specifically for your business logic.
Rapid Iteration
A typical training run of just a few epochs quickly adapts the model. This is a truly innovative approach, enabling agile updates to match evolving requirements or new function signatures.
Scalable
Despite the model’s small size, you can extend the training data seamlessly. As new parameters or entirely new functions emerge, simply add them to the training set and run the script again.
In short, you don’t need a huge ML pipeline—just minimal code and data. Our novel approach ensures top-tier performance with minimal overhead, empowering capital markets teams to create private, agentic solutions on their own infrastructure.
Performance and Metrics
High Accuracy on parameter extraction from real-world financial queries.
Minimal Hallucination for short, well-structured prompts.
Smooth Generalization to novel queries involving a mix of known parameters.
Complex or ambiguous requests might require clarifying instructions or additional data. Nevertheless, in practice, our fine-tuned T5 has demonstrated strong consistency, making it a reliable component of capital market automation.
Usage Example
python
1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
23model_name ="usmankhanic/apexe3-dec-enc-fn-v0011"4tokenizer = AutoTokenizer.from_pretrained(model_name)5model = AutoModelForSeq2SeqLM.from_pretrained(model_name)67# Sample prompt aligns with training format8input_text =(9"Your job is to pick the correct function name and produce key=value lines.\n\n"10"Query: Select the top growth stocks in the healthcare sector from 2021 to 2023.\n\n"11"Format:\nfunction_name=<NAME>\nparam1=value\nparam2=value\n"12)1314inputs = tokenizer(input_text, return_tensors="pt")15outputs = model.generate(16**inputs,17 max_length=128,# Increase if you expect longer output18 num_beams=4,19 early_stopping=True20)2122generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)23print(generated_text)