Upload folder using huggingface_hub
Browse files- README.md +111 -0
- config.json +52 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +13 -0
README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- code
|
| 7 |
+
- solidity
|
| 8 |
+
- blockchain
|
| 9 |
+
- smart-contracts
|
| 10 |
+
- code-generation
|
| 11 |
+
- ethereum
|
| 12 |
+
- web3
|
| 13 |
+
- daml
|
| 14 |
+
base_model: Chain-GPT/Solidity-LLM
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
library_name: transformers
|
| 17 |
+
---
|
| 18 |
+
<div align="center">
|
| 19 |
+
# 🧞 Ginie — Solidity Smart Contract LLM
|
| 20 |
+
**The AI built for Web3 developers**
|
| 21 |
+
[](https://ginie.xyz)
|
| 22 |
+
[](https://opensource.org/licenses/MIT)
|
| 23 |
+
[]()
|
| 24 |
+
[]()
|
| 25 |
+
</div>
|
| 26 |
+
---
|
| 27 |
+
## What is Ginie?
|
| 28 |
+
**Ginie AI** is the world's first specialized AI assistant for **Daml + Solidity smart contract generation**,
|
| 29 |
+
built for the institutional blockchain ecosystem on [Canton Network](https://canton.network).
|
| 30 |
+
This model — **Ginie Solidity LLM v1.0** — generates production-quality Solidity smart contracts
|
| 31 |
+
from plain English instructions. It understands ERC standards, OpenZeppelin patterns, DeFi protocols,
|
| 32 |
+
DAOs, governance, and more.
|
| 33 |
+
> 🌐 Try the live demo: [huggingface.co/spaces/GinieAI/Ginie-Demo](https://huggingface.co/spaces/GinieAI/Ginie-Demo)
|
| 34 |
+
---
|
| 35 |
+
## Quickstart
|
| 36 |
+
```python
|
| 37 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 38 |
+
import torch
|
| 39 |
+
tokenizer = AutoTokenizer.from_pretrained("GinieAI/Solidity-LLM")
|
| 40 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 41 |
+
"GinieAI/Solidity-LLM",
|
| 42 |
+
torch_dtype=torch.bfloat16,
|
| 43 |
+
device_map="cuda"
|
| 44 |
+
)
|
| 45 |
+
prompt = """### Instruction:
|
| 46 |
+
Write a Solidity ERC20 token contract with minting, burning, and owner controls.
|
| 47 |
+
### Response:
|
| 48 |
+
"""
|
| 49 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 50 |
+
outputs = model.generate(
|
| 51 |
+
**inputs,
|
| 52 |
+
max_new_tokens=800,
|
| 53 |
+
temperature=0.7,
|
| 54 |
+
do_sample=True,
|
| 55 |
+
pad_token_id=tokenizer.eos_token_id
|
| 56 |
+
)
|
| 57 |
+
print(tokenizer.decode(outputs, skip_special_tokens=True))
|
| 58 |
+
```
|
| 59 |
+
---
|
| 60 |
+
## Model Details
|
| 61 |
+
| Property | Value |
|
| 62 |
+
|---|---|
|
| 63 |
+
| **Developer** | [Ginie AI](https://ginie.xyz) |
|
| 64 |
+
| **Model type** | Causal LM — Code Generation |
|
| 65 |
+
| **Parameters** | 2 Billion |
|
| 66 |
+
| **Architecture** | 32 Transformer blocks |
|
| 67 |
+
| **Context length** | 2048 tokens |
|
| 68 |
+
| **Precision** | bfloat16 |
|
| 69 |
+
| **Tokenizer** | GPT-2 |
|
| 70 |
+
| **Language** | Solidity (Ethereum-compatible) |
|
| 71 |
+
| **License** | MIT |
|
| 72 |
+
---
|
| 73 |
+
## Performance Benchmarks
|
| 74 |
+
| Metric | Ginie v1 | GPT-4o mini | DeepSeek-Coder-7B |
|
| 75 |
+
|---|---|---|---|
|
| 76 |
+
| Compilation Rate | **83%** | 78% | 75% |
|
| 77 |
+
| OpenZeppelin Compliance | **65%** | 61% | 58% |
|
| 78 |
+
| Gas Efficiency | **72%** | 65% | 63% |
|
| 79 |
+
| Security Score | **58%** | 54% | 51% |
|
| 80 |
+
---
|
| 81 |
+
## Use Cases
|
| 82 |
+
- ✅ Generating ERC20, ERC721, ERC1155 token contracts
|
| 83 |
+
- ✅ DeFi protocols — staking, liquidity, yield farming
|
| 84 |
+
- ✅ DAO and governance contracts
|
| 85 |
+
- ✅ Multisig wallets and escrow
|
| 86 |
+
- ✅ NFT marketplaces
|
| 87 |
+
- ✅ Canton Network / Daml integration (v2 roadmap)
|
| 88 |
+
## Not suitable for
|
| 89 |
+
- ❌ Production deployment without expert review
|
| 90 |
+
- ❌ Non-Solidity languages (v2 roadmap includes Rust/Daml)
|
| 91 |
+
- ❌ Legal or formal contract auditing
|
| 92 |
+
---
|
| 93 |
+
## Roadmap
|
| 94 |
+
| Version | What's new |
|
| 95 |
+
|---|---|
|
| 96 |
+
| **v1.0** (now) | Base Solidity generation — 2B params |
|
| 97 |
+
| **v2.0** | +7,800 training examples — DISL + Zellic corpus |
|
| 98 |
+
| **v3.0** | Daml smart contract support — Canton Network |
|
| 99 |
+
| **v4.0** | Real user data flywheel — weekly retraining |
|
| 100 |
+
---
|
| 101 |
+
## License & Attribution
|
| 102 |
+
This model is released under the **MIT License**.
|
| 103 |
+
Built on top of [Chain-GPT/Solidity-LLM](https://huggingface.co/Chain-GPT/Solidity-LLM)
|
| 104 |
+
by [ChainGPT](https://chaingpt.org), which is itself fine-tuned from
|
| 105 |
+
[Salesforce/codegen-2B-multi](https://huggingface.co/Salesforce/codegen-2B-multi).
|
| 106 |
+
Full credit to the original authors. Ginie AI extends this work for the
|
| 107 |
+
institutional Canton/Daml ecosystem.
|
| 108 |
+
---
|
| 109 |
+
## About Ginie AI
|
| 110 |
+
Ginie AI is building the developer layer for institutional blockchain.
|
| 111 |
+
🌐 [ginie.xyz](https://ginie.xyz)
|
config.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu_new",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"CodeGenForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attn_pdrop": 0.0,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"embd_pdrop": 0.0,
|
| 10 |
+
"eos_token_id": 50256,
|
| 11 |
+
"gradient_checkpointing": false,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"layer_norm_epsilon": 1e-05,
|
| 14 |
+
"model_type": "codegen",
|
| 15 |
+
"n_ctx": 2048,
|
| 16 |
+
"n_embd": 2560,
|
| 17 |
+
"n_head": 32,
|
| 18 |
+
"n_inner": null,
|
| 19 |
+
"n_layer": 32,
|
| 20 |
+
"n_positions": 2048,
|
| 21 |
+
"resid_pdrop": 0.0,
|
| 22 |
+
"rotary_dim": 64,
|
| 23 |
+
"scale_attn_weights": true,
|
| 24 |
+
"summary_activation": null,
|
| 25 |
+
"summary_first_dropout": 0.1,
|
| 26 |
+
"summary_proj_to_labels": true,
|
| 27 |
+
"summary_type": "cls_index",
|
| 28 |
+
"summary_use_proj": true,
|
| 29 |
+
"task_specific_params": {
|
| 30 |
+
"text-generation": {
|
| 31 |
+
"do_sample": true,
|
| 32 |
+
"max_length": 50,
|
| 33 |
+
"temperature": 1.0
|
| 34 |
+
}
|
| 35 |
+
},
|
| 36 |
+
"tie_word_embeddings": false,
|
| 37 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 38 |
+
"transformers_version": "5.0.0",
|
| 39 |
+
"use_cache": true,
|
| 40 |
+
"vocab_size": 51200,
|
| 41 |
+
"_name_or_path": "GinieAI/Solidity-LLM",
|
| 42 |
+
"ginie_metadata": {
|
| 43 |
+
"model_name": "Ginie Solidity LLM",
|
| 44 |
+
"version": "1.0.0",
|
| 45 |
+
"developed_by": "Ginie AI",
|
| 46 |
+
"website": "https://ginie.xyz",
|
| 47 |
+
"base_model": "Chain-GPT/Solidity-LLM",
|
| 48 |
+
"original_base": "Salesforce/codegen-2B-multi",
|
| 49 |
+
"license": "MIT",
|
| 50 |
+
"use_case": "Solidity smart contract generation"
|
| 51 |
+
}
|
| 52 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 50256,
|
| 5 |
+
"transformers_version": "5.0.0"
|
| 6 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b91b72289f6fb6deb0bcb39fedd445de67266f6181f31793fdd5a28d5252187
|
| 3 |
+
size 5558740600
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"is_local": false,
|
| 8 |
+
"model_max_length": 2048,
|
| 9 |
+
"model_specific_special_tokens": {},
|
| 10 |
+
"return_token_type_ids": false,
|
| 11 |
+
"tokenizer_class": "TokenizersBackend",
|
| 12 |
+
"unk_token": "<|endoftext|>"
|
| 13 |
+
}
|