infraxa commited on
Commit
683aa2b
·
verified ·
1 Parent(s): 2355d29

Initial release: Qwen3.5-Trading-Agent — GRPO-finetuned on Solana trading data

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen3.5-35B-A3B
4
+ tags:
5
+ - trading
6
+ - solana
7
+ - defi
8
+ - prediction-markets
9
+ - grpo
10
+ - moe
11
+ - autonomous-agents
12
+ - infraxa
13
+ language:
14
+ - en
15
+ pipeline_tag: text-generation
16
+ library_name: transformers
17
+ model-index:
18
+ - name: Qwen3.5-Trading-Agent
19
+ results: []
20
+ ---
21
+
22
+ # Qwen3.5-Trading-Agent
23
+
24
+ **By [Infraxa](https://infraxa.ai) — The Execution Layer for Autonomous Finance**
25
+
26
+ A GRPO-finetuned Qwen3.5-35B-A3B Mixture-of-Experts model, trained on Solana on-chain trading data and prediction market signals. Built for autonomous trade execution, swap routing, and market reasoning.
27
+
28
+ ## Model Details
29
+
30
+ | Parameter | Value |
31
+ |---|---|
32
+ | Base Model | Qwen3.5-35B-A3B (MoE) |
33
+ | Architecture | `Qwen3_5MoeForCausalLM` |
34
+ | Total Parameters | ~35B |
35
+ | Active Parameters | ~3B per token |
36
+ | Experts | 256 total, 8 active per token |
37
+ | Hidden Size | 2048 |
38
+ | Layers | 40 (30 linear attention + 10 full attention) |
39
+ | Context Length | 262,144 tokens |
40
+ | Precision | bfloat16 |
41
+ | Training Method | GRPO (Group Relative Policy Optimization) |
42
+
43
+ ## Training Data
44
+
45
+ This model was GRPO-trained on:
46
+
47
+ - **Solana on-chain transaction data** — real swap and trade executions across DEXs
48
+ - **Prediction market data** — outcomes, odds, and resolution signals
49
+ - **Trading run logs** — full execution traces including routing, slippage, and settlement
50
+
51
+ The training objective optimizes for accurate trade reasoning: identifying optimal swap routes, predicting market movements, and generating executable trade instructions.
52
+
53
+ ## Intended Use
54
+
55
+ - Autonomous trading agents on Solana
56
+ - Swap execution and routing decisions
57
+ - Prediction market analysis and position sizing
58
+ - On-chain data interpretation and trade signal generation
59
+ - Integration with Infraxa's execution layer for gasless, agent-driven finance
60
+
61
+ ## Architecture
62
+
63
+ Qwen3.5-35B-A3B uses a hybrid attention design with both linear and full attention layers in a 3:1 ratio. The MoE architecture (256 experts, 8 active) gives the model high capacity while keeping inference costs low — only ~3B parameters are active per forward pass.
64
+
65
+ ## How to Use
66
+
67
+ ```python
68
+ from transformers import AutoModelForCausalLM, AutoTokenizer
69
+
70
+ model_name = "infraxaai/Qwen3.5-Trading-Agent"
71
+
72
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
73
+ model = AutoModelForCausalLM.from_pretrained(
74
+ model_name,
75
+ torch_dtype="bfloat16",
76
+ device_map="auto",
77
+ )
78
+
79
+ prompt = "Analyze the current SOL/USDC liquidity across Orca, Raydium, and Jupiter. Recommend the optimal swap route for 10,000 USDC."
80
+ messages = [{"role": "user", "content": prompt}]
81
+
82
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
83
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
84
+ outputs = model.generate(**inputs, max_new_tokens=512)
85
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
86
+ ```
87
+
88
+ ## Links
89
+
90
+ - [Infraxa Platform](https://infraxa.ai)
91
+ - [Infraxa Docs](https://docs.infraxa.ai)
92
+ - [Infraxa Dashboard](https://dashboard.infraxa.ai)
93
+ - [Twitter](https://twitter.com/infraxa)
94
+
95
+ ## License
96
+
97
+ Apache 2.0 — same as the base Qwen3.5 model.
config.json ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5MoeForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "attn_output_gate": true,
8
+ "bos_token_id": null,
9
+ "dtype": "bfloat16",
10
+ "eos_token_id": 248044,
11
+ "full_attention_interval": 4,
12
+ "head_dim": 256,
13
+ "hidden_act": "silu",
14
+ "hidden_size": 2048,
15
+ "initializer_range": 0.02,
16
+ "layer_types": [
17
+ "linear_attention",
18
+ "linear_attention",
19
+ "linear_attention",
20
+ "full_attention",
21
+ "linear_attention",
22
+ "linear_attention",
23
+ "linear_attention",
24
+ "full_attention",
25
+ "linear_attention",
26
+ "linear_attention",
27
+ "linear_attention",
28
+ "full_attention",
29
+ "linear_attention",
30
+ "linear_attention",
31
+ "linear_attention",
32
+ "full_attention",
33
+ "linear_attention",
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "full_attention",
37
+ "linear_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "full_attention",
41
+ "linear_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "full_attention",
45
+ "linear_attention",
46
+ "linear_attention",
47
+ "linear_attention",
48
+ "full_attention",
49
+ "linear_attention",
50
+ "linear_attention",
51
+ "linear_attention",
52
+ "full_attention",
53
+ "linear_attention",
54
+ "linear_attention",
55
+ "linear_attention",
56
+ "full_attention"
57
+ ],
58
+ "linear_conv_kernel_dim": 4,
59
+ "linear_key_head_dim": 128,
60
+ "linear_num_key_heads": 16,
61
+ "linear_num_value_heads": 32,
62
+ "linear_value_head_dim": 128,
63
+ "mamba_ssm_dtype": "float32",
64
+ "max_position_embeddings": 262144,
65
+ "mlp_only_layers": [],
66
+ "model_type": "qwen3_5_moe",
67
+ "moe_intermediate_size": 512,
68
+ "mtp_num_hidden_layers": 1,
69
+ "mtp_use_dedicated_embeddings": false,
70
+ "num_attention_heads": 16,
71
+ "num_experts": 256,
72
+ "num_experts_per_tok": 8,
73
+ "num_hidden_layers": 40,
74
+ "num_key_value_heads": 2,
75
+ "output_router_logits": false,
76
+ "pad_token_id": null,
77
+ "partial_rotary_factor": 0.25,
78
+ "rms_norm_eps": 1e-06,
79
+ "rope_parameters": {
80
+ "mrope_interleaved": true,
81
+ "mrope_section": [
82
+ 11,
83
+ 11,
84
+ 10
85
+ ],
86
+ "partial_rotary_factor": 0.25,
87
+ "rope_theta": 10000000,
88
+ "rope_type": "default"
89
+ },
90
+ "router_aux_loss_coef": 0.001,
91
+ "shared_expert_intermediate_size": 512,
92
+ "tie_word_embeddings": false,
93
+ "transformers_version": "5.3.0",
94
+ "use_cache": true,
95
+ "vocab_size": 248320
96
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 248044,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 248046,
6
+ 248044
7
+ ],
8
+ "pad_token_id": 248044,
9
+ "temperature": 1.0,
10
+ "top_k": 20,
11
+ "top_p": 0.95,
12
+ "transformers_version": "5.3.0"
13
+ }
model-00001-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1a486a1843c667ccee6ec4dfc3a0aae7bbd0ac535fcfd336ecfdae96dbfc67e
3
+ size 9367719424
model-00002-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7edb55e18a3ffb4e20cc1fc604a88ec087bff7681103974e88bee8050e017e5c
3
+ size 9563246736
model-00003-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5eb00c2c637538da10a12a8651d92bdba9cdfb8cfeccd979a7076e3f6e6ff300
3
+ size 9984153464
model-00004-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ce96d4ac708304169460e3fd35d9b945e78de31952dfac0e45da6602907513e
3
+ size 9054647680
model-00005-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f94fb4520cd9272114999a0721f6e1111ede2098507dead54c61c57d2b8a764d
3
+ size 9495812992
model-00006-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8d39e62b08903fd645d10c606a276a1863f509da34345865a2706329356849a
3
+ size 9006081096
model-00007-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2bdcdf167b4f54aeb7dd46374515c7e9576ecd3224d919c6adae22b3437d483
3
+ size 9563251112
model-00008-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49c238bae2b57d6ff851d5dd29a1d46784b4e3f01b084585b32c9becc4cc2bb7
3
+ size 3290673592
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
3
+ size 19989343
tokenizer_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": false,
13
+ "model_max_length": 262144,
14
+ "model_specific_special_tokens": {
15
+ "audio_bos_token": "<|audio_start|>",
16
+ "audio_eos_token": "<|audio_end|>",
17
+ "audio_token": "<|audio_pad|>",
18
+ "image_token": "<|image_pad|>",
19
+ "video_token": "<|video_pad|>",
20
+ "vision_bos_token": "<|vision_start|>",
21
+ "vision_eos_token": "<|vision_end|>"
22
+ },
23
+ "pad_token": "<|endoftext|>",
24
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
25
+ "split_special_tokens": false,
26
+ "tokenizer_class": "TokenizersBackend",
27
+ "unk_token": null,
28
+ "video_token": "<|video_pad|>",
29
+ "vision_bos_token": "<|vision_start|>",
30
+ "vision_eos_token": "<|vision_end|>"
31
+ }