Files changed (1) hide show
  1. README.md +160 -70
README.md CHANGED
@@ -1,13 +1,13 @@
1
  # Ginie β€” Smart Contract LLM
2
 
3
- The first AI model purpose-built to generate, compile, audit, and deploy smart contracts across institutional and public blockchains. Plain English in. Production-ready contract out. On-chain in under 90 seconds.
4
-
5
- [![Website](https://img.shields.io/badge/Website-ginie.xyz-blue)](https://ginie.xyz)
6
  [![npm](https://img.shields.io/badge/npm-30k%2B_weekly_downloads-red)](https://npmjs.com/package/ginie-sdk)
 
7
  [![License](https://img.shields.io/badge/License-MIT-green)](https://opensource.org/licenses/MIT)
8
  [![Demo](https://img.shields.io/badge/Demo-Live-brightgreen)](https://huggingface.co/spaces/GinieAI/Ginie-Demo)
9
  [![Canton](https://img.shields.io/badge/Canton_Network-Supported-purple)](https://canton.network)
10
 
 
 
11
  ---
12
 
13
  ## What is Ginie?
@@ -16,12 +16,11 @@ Ginie is the developer layer for the next generation of on-chain applications. T
16
 
17
  Write a description. Get a contract that compiles, passes security checks, and deploys β€” across Solidity (Ethereum, Avalanche, Camp Network), Daml (Canton Network), and Rust (Vara Network).
18
 
19
- Canton Network alone processes $6 trillion in tokenised assets, backed by Goldman Sachs, JPMorgan, and DTCC. Every institution building on it needs smart contracts. Ginie writes them.
20
 
21
  ---
22
 
23
  ## Quickstart
24
-
25
  ```python
26
  from transformers import AutoModelForCausalLM, AutoTokenizer
27
  import torch
@@ -30,7 +29,7 @@ tokenizer = AutoTokenizer.from_pretrained("GinieAI/Solidity-LLM")
30
  model = AutoModelForCausalLM.from_pretrained(
31
  "GinieAI/Solidity-LLM",
32
  torch_dtype=torch.bfloat16,
33
- device_map="cuda"
34
  )
35
 
36
  prompt = """### Instruction:
@@ -39,7 +38,7 @@ Write a Solidity ERC20 token contract with minting, burning, and owner controls.
39
  ### Response:
40
  """
41
 
42
- inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
43
  outputs = model.generate(
44
  **inputs,
45
  max_new_tokens=800,
@@ -49,13 +48,13 @@ outputs = model.generate(
49
  )
50
 
51
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
 
52
 
53
-
54
- npm SDK β€” 30,000+ active weekly downloads
55
-
56
  npm install ginie-sdk
57
-
58
-
59
  import { Ginie } from 'ginie-sdk'
60
 
61
  const ginie = new Ginie({ apiKey: 'your-key' })
@@ -69,85 +68,176 @@ const contract = await ginie.generate({
69
  console.log(contract.code)
70
  console.log(contract.securityScore)
71
  console.log(contract.compiled)
 
72
 
 
73
 
74
- Model Details
75
 
 
76
 
 
 
 
 
 
 
 
 
 
 
77
 
78
- |Property |Value |
79
- |--------------|-----------------------------|
80
- |Developer |[Ginie AI](https://ginie.xyz)|
81
- |Model type |Causal LM β€” Code Generation |
82
- |Parameters |2 Billion |
83
- |Architecture |32 Transformer blocks |
84
- |Context length|2048 tokens |
85
- |Precision |bfloat16 |
86
- |Tokenizer |GPT-2 |
87
- |Base model |Chain-GPT/Solidity-LLM |
88
- |License |MIT |
89
 
90
- Performance
91
- Evaluated against GPT-4o mini and DeepSeek-Coder-7B on 100 Solidity contract generation prompts. Compilation success and security assessed via Slither static analysis. OpenZeppelin compliance assessed against standard library usage patterns.
 
92
 
 
93
 
 
94
 
95
- |Metric |Ginie v1|GPT-4o mini|DeepSeek-Coder-7B|
96
- |-----------------------|--------|-----------|-----------------|
97
- |Compilation rate |**83%** |78% |75% |
98
- |OpenZeppelin compliance|**65%** |61% |58% |
99
- |Gas efficiency |**72%** |65% |63% |
100
- |Security score |**58%** |54% |51% |
101
 
102
- Ginie achieves the highest compilation rate despite being the smallest model in the comparison β€” a direct result of domain specialisation over general-purpose scale.
 
 
 
 
 
103
 
104
- What Ginie generates today
105
- βˆ™ ERC20, ERC721, ERC1155 token contracts
106
- βˆ™ DeFi protocols β€” staking, liquidity pools, yield farming
107
- βˆ™ DAO and governance contracts
108
- βˆ™ Multisig wallets and escrow agreements
109
- βˆ™ NFT marketplaces
110
- βˆ™ Automated compliance and audit loops
111
- Chains supported
112
 
 
 
 
113
 
 
114
 
115
- |Chain |Language|Status |
116
- |--------------|--------|----------|
117
- |Ethereum |Solidity|Live |
118
- |Avalanche |Solidity|Live |
119
- |Camp Network |Solidity|Live |
120
- |Canton Network|Daml |v3 roadmap|
121
- |Vara Network |Rust |v3 roadmap|
122
 
123
- Not suitable for
124
- βˆ™ Production deployment without expert review
125
- βˆ™ Formal legal contract auditing
126
- βˆ™ Non-code generation tasks
127
 
128
- Roadmap
 
 
 
129
 
 
130
 
 
131
 
132
- |Version |What ships |
133
- |----------|---------------------------------------------------------|
134
- |v1.0 (now)|Solidity generation β€” 2B params, 83% compile rate |
135
- |v2.0 |Expanded corpus β€” DISL + Zellic, 7,800+ training examples|
136
- |v3.0 |Daml and Rust support β€” Canton Network and Vara Network |
137
- |v4.0 |Data flywheel β€” weekly retraining on real user prompts |
138
 
139
- The v4 flywheel is the permanent moat. Every contract a user successfully generates becomes a training example for the next version. The model improves weekly from real usage β€” a data distribution no statically trained competitor can replicate.
 
 
 
 
 
140
 
141
- Training
142
- Ginie v1 is fine-tuned from Chain-GPT/Solidity-LLM using LoRA on a curated Solidity instruction dataset. Training focused on instruction-following quality, OpenZeppelin pattern adherence, and compilable output over raw token prediction.
143
- Security validation uses Slither static analysis. Compilation validation uses solc. Both are integrated into the generation pipeline β€” not just evaluation.
144
 
145
- License and Attribution
146
- Released under the MIT License.
147
- Built on Chain-GPT/Solidity-LLM by ChainGPT, which is fine-tuned from Salesforce/codegen-2B-multi. Full credit to the original authors. Ginie extends this work for the institutional blockchain ecosystem.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
- About Ginie AI
150
- Ginie AI is building the developer layer for institutional blockchain. Backed by the Canton Foundation and supported by the Canton Network ecosystem β€” the institutional blockchain processing $6 trillion in tokenised assets with Goldman Sachs, JPMorgan, and DTCC.
151
- ginie.xyz Β· npm SDK Β· Live demo
152
 
153
- Smart contracts generated by Ginie should be reviewed by a qualified developer before production deployment. Security scores are indicative and do not constitute a formal audit.
 
1
  # Ginie β€” Smart Contract LLM
2
 
 
 
 
3
  [![npm](https://img.shields.io/badge/npm-30k%2B_weekly_downloads-red)](https://npmjs.com/package/ginie-sdk)
4
+ [![Website](https://img.shields.io/badge/Website-ginie.xyz-blue)](https://ginie.xyz)
5
  [![License](https://img.shields.io/badge/License-MIT-green)](https://opensource.org/licenses/MIT)
6
  [![Demo](https://img.shields.io/badge/Demo-Live-brightgreen)](https://huggingface.co/spaces/GinieAI/Ginie-Demo)
7
  [![Canton](https://img.shields.io/badge/Canton_Network-Supported-purple)](https://canton.network)
8
 
9
+ The first AI model purpose-built to generate, compile, audit, and deploy smart contracts across institutional and public blockchains. Plain English in. Production-ready contract out. On-chain in under 90 seconds.
10
+
11
  ---
12
 
13
  ## What is Ginie?
 
16
 
17
  Write a description. Get a contract that compiles, passes security checks, and deploys β€” across Solidity (Ethereum, Avalanche, Camp Network), Daml (Canton Network), and Rust (Vara Network).
18
 
19
+ Canton Network processes $6 trillion in tokenised assets, backed by Goldman Sachs, JPMorgan, and DTCC. Every institution building on it needs smart contracts. Ginie writes them.
20
 
21
  ---
22
 
23
  ## Quickstart
 
24
  ```python
25
  from transformers import AutoModelForCausalLM, AutoTokenizer
26
  import torch
 
29
  model = AutoModelForCausalLM.from_pretrained(
30
  "GinieAI/Solidity-LLM",
31
  torch_dtype=torch.bfloat16,
32
+ device_map="auto"
33
  )
34
 
35
  prompt = """### Instruction:
 
38
  ### Response:
39
  """
40
 
41
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
42
  outputs = model.generate(
43
  **inputs,
44
  max_new_tokens=800,
 
48
  )
49
 
50
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
51
+ ```
52
 
53
+ **npm SDK** β€” 30,000+ active weekly downloads
54
+ ```bash
 
55
  npm install ginie-sdk
56
+ ```
57
+ ```javascript
58
  import { Ginie } from 'ginie-sdk'
59
 
60
  const ginie = new Ginie({ apiKey: 'your-key' })
 
68
  console.log(contract.code)
69
  console.log(contract.securityScore)
70
  console.log(contract.compiled)
71
+ ```
72
 
73
+ ---
74
 
75
+ ## Model Details
76
 
77
+ ### Model Description
78
 
79
+ - **Developed by:** [Ginie AI](https://ginie.xyz)
80
+ - **Model type:** Causal LM β€” Code Generation
81
+ - **Language:** English instructions β†’ Solidity / Daml
82
+ - **Parameters:** 2 Billion
83
+ - **Architecture:** 32 Transformer blocks
84
+ - **Context length:** 2048 tokens
85
+ - **Precision:** bfloat16
86
+ - **Tokenizer:** GPT2Tokenizer
87
+ - **Finetuned from:** [Chain-GPT/Solidity-LLM](https://huggingface.co/Chain-GPT/Solidity-LLM)
88
+ - **License:** MIT
89
 
90
+ ### Model Sources
 
 
 
 
 
 
 
 
 
 
91
 
92
+ - **Demo:** [huggingface.co/spaces/GinieAI/Ginie-Demo](https://huggingface.co/spaces/GinieAI/Ginie-Demo)
93
+ - **Website:** [ginie.xyz](https://ginie.xyz)
94
+ - **npm SDK:** [npmjs.com/package/ginie-sdk](https://npmjs.com/package/ginie-sdk)
95
 
96
+ ---
97
 
98
+ ## Uses
99
 
100
+ ### Direct Use
 
 
 
 
 
101
 
102
+ - ERC20, ERC721, ERC1155 token contracts
103
+ - DeFi protocols β€” staking, liquidity pools, yield farming
104
+ - DAO and governance contracts
105
+ - Multisig wallets and escrow agreements
106
+ - NFT marketplaces
107
+ - Automated compliance and audit loops
108
 
109
+ ### Downstream Use
 
 
 
 
 
 
 
110
 
111
+ - Integrated into IDEs and smart contract development platforms
112
+ - Embedded in agentic pipelines for autonomous contract deployment
113
+ - npm SDK for direct integration in any JavaScript or TypeScript project
114
 
115
+ ### Out-of-Scope Use
116
 
117
+ - Production deployment without expert review
118
+ - Formal legal or compliance auditing
119
+ - Non-code generation tasks
 
 
 
 
120
 
121
+ ### Bias, Risks, and Limitations
 
 
 
122
 
123
+ - May reflect patterns from web-scraped Solidity including outdated or insecure practices
124
+ - Can generate syntactically valid but logically incorrect contracts
125
+ - Security score is indicative β€” not a substitute for a professional audit
126
+ - All generated contracts must be reviewed before mainnet deployment
127
 
128
+ ---
129
 
130
+ ## How to Get Started
131
 
132
+ See the [Quickstart](#quickstart) section above. For streaming output:
133
+ ```python
134
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
135
+ import torch
 
 
136
 
137
+ tokenizer = AutoTokenizer.from_pretrained("GinieAI/Solidity-LLM")
138
+ model = AutoModelForCausalLM.from_pretrained(
139
+ "GinieAI/Solidity-LLM",
140
+ torch_dtype=torch.bfloat16,
141
+ device_map="auto"
142
+ )
143
 
144
+ prompt = """### Instruction:
145
+ Write a Solidity staking contract with reward distribution.
 
146
 
147
+ ### Response:
148
+ """
149
+
150
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
151
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
152
+
153
+ model.generate(
154
+ **inputs,
155
+ max_new_tokens=1000,
156
+ temperature=0.7,
157
+ do_sample=True,
158
+ streamer=streamer,
159
+ pad_token_id=tokenizer.eos_token_id
160
+ )
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Training Details
166
+
167
+ ### Training Data
168
+
169
+ - [AlfredPros/smart-contracts-instructions](https://huggingface.co/datasets/AlfredPros/smart-contracts-instructions) β€” 6,000 instruction-output pairs
170
+ - Filtered: Solidity >= 0.5, token length 200–4000, compilable contracts only
171
+ - Deduplicated and validated before training
172
+
173
+ ### Training Procedure
174
+
175
+ - **Method:** LoRA fine-tuning (rank 16, alpha 16)
176
+ - **Base:** Chain-GPT/Solidity-LLM β†’ Salesforce/codegen-2B-multi
177
+ - **Epochs:** 3
178
+ - **Precision:** bfloat16
179
+ - **Framework:** Unsloth + HuggingFace TRL
180
+ - **Validation:** Slither static analysis + solc compilation check
181
+
182
+ ---
183
+
184
+ ## Evaluation
185
+
186
+ Evaluated on 100 held-out Solidity prompts. Compilation measured via `solc`. Security measured via [Slither](https://github.com/crytic/slither).
187
+
188
+ | Metric | Ginie v1 | GPT-4o mini | DeepSeek-Coder-7B |
189
+ |---|---|---|---|
190
+ | Compilation rate | **83%** | 78% | 75% |
191
+ | OpenZeppelin compliance | **65%** | 61% | 58% |
192
+ | Gas efficiency | **72%** | 65% | 63% |
193
+ | Security score | **58%** | 54% | 51% |
194
+
195
+ Ginie achieves the highest compilation rate at 2B parameters β€” domain specialisation over general-purpose scale.
196
+
197
+ ---
198
+
199
+ ## Chains Supported
200
+
201
+ | Blockchain | Language | Status |
202
+ |---|---|---|
203
+ | Ethereum | Solidity | Live |
204
+ | Avalanche | Solidity | Live |
205
+ | Camp Network | Solidity | Live |
206
+ | Canton Network | Daml | v3 roadmap |
207
+ | Vara Network | Rust | v3 roadmap |
208
+
209
+ ---
210
+
211
+ ## Roadmap
212
+
213
+ | Version | What ships |
214
+ |---|---|
215
+ | v1.0 (current) | Solidity generation β€” 2B params, 83% compile rate |
216
+ | v2.0 | Expanded corpus β€” DISL + Zellic, 7,800+ examples, security score 70%+ |
217
+ | v3.0 | Daml + Rust β€” Canton Network and Vara Network |
218
+ | v4.0 | Weekly retraining flywheel on verified user prompts |
219
+
220
+ ---
221
+
222
+ ## Citation
223
+ ```bibtex
224
+ @misc{ginie2025,
225
+ title = {Ginie: Smart Contract LLM for Institutional Blockchain},
226
+ author = {Ginie AI},
227
+ year = {2025},
228
+ url = {https://huggingface.co/GinieAI/Solidity-LLM},
229
+ note = {Fine-tuned from Chain-GPT/Solidity-LLM (Salesforce/codegen-2B-multi)}
230
+ }
231
+ ```
232
+
233
+ ---
234
+
235
+ ## License and Attribution
236
+
237
+ Released under the MIT License. Built on [Chain-GPT/Solidity-LLM](https://huggingface.co/Chain-GPT/Solidity-LLM) by ChainGPT, fine-tuned from [Salesforce/codegen-2B-multi](https://huggingface.co/Salesforce/codegen-2B-multi). Full credit to the original authors.
238
+
239
+ ---
240
 
241
+ [ginie.xyz](https://ginie.xyz) Β· [npm SDK](https://npmjs.com/package/ginie-sdk) Β· [Live demo](https://huggingface.co/spaces/GinieAI/Ginie-Demo)
 
 
242
 
243
+ > Smart contracts generated by Ginie require expert review before production deployment. Security scores are indicative and do not constitute a formal audit.