Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Solidity-CodeGen-v0.1
|
| 2 |
|
| 3 |
Solidity-CodeGen-v0.1 is a fine-tuned LLM specialized for generating Solidity smart contracts with modern OpenZeppelin patterns. It works best when paired with the OpenZeppelin Contracts MCP (Model Context Protocol) to produce canonical ERC and Governor implementations.
|
|
@@ -8,13 +21,14 @@ Solidity-CodeGen-v0.1 is a fine-tuned LLM specialized for generating Solidity sm
|
|
| 8 |
|
| 9 |
## How to Load
|
| 10 |
Transformers:
|
|
|
|
| 11 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 12 |
tok = AutoTokenizer.from_pretrained("credshields/Solidity-CodeGen-v0.1")
|
| 13 |
model = AutoModelForCausalLM.from_pretrained("credshields/Solidity-CodeGen-v0.1", torch_dtype="auto", device_map="auto")
|
| 14 |
-
|
| 15 |
|
| 16 |
vLLM:
|
| 17 |
-
vllm serve YOUR_ORG/Solidity-CodeGen-v0.1 --dtype auto --port 8005
|
| 18 |
|
| 19 |
|
| 20 |
## Recommended: Use OpenZeppelin MCP (Locally)
|
|
@@ -29,11 +43,14 @@ This model card does not include MCP files; use the official OZ MCP project loca
|
|
| 29 |
When MCP is unavailable, use structured prompts:
|
| 30 |
|
| 31 |
- Start with:
|
|
|
|
| 32 |
- “Generate only Solidity code in a single ```
|
| 33 |
- “Solidity: ^0.8.27 and OpenZeppelin v5 imports only (@openzeppelin/contracts/...).”
|
| 34 |
- Specify contract type, features, and constraints.
|
|
|
|
| 35 |
|
| 36 |
Example (ERC20 minimal, mintable):
|
|
|
|
| 37 |
Generate only Solidity code in a single ```
|
| 38 |
Solidity: ^0.8.27, OpenZeppelin v5 imports only.
|
| 39 |
Contract: ERC20 token
|
|
@@ -44,7 +61,7 @@ Constraints:
|
|
| 44 |
Imports: ERC20, Ownable
|
| 45 |
constructor(address initialOwner) and Ownable(initialOwner)
|
| 46 |
No burn, no pause, no permit
|
| 47 |
-
|
| 48 |
|
| 49 |
## Quality and Limitations
|
| 50 |
- With MCP: ERC20/721/1155 and Governor scaffolds are canonical; custom templates are solid but require review.
|
|
@@ -61,4 +78,4 @@ No burn, no pause, no permit
|
|
| 61 |
- Generated code: user responsibility; OpenZeppelin Contracts are MIT-licensed.
|
| 62 |
|
| 63 |
## Note
|
| 64 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model:
|
| 6 |
+
- Qwen/Qwen3-4B-Instruct-2507
|
| 7 |
+
tags:
|
| 8 |
+
- solidity
|
| 9 |
+
- smart_contract
|
| 10 |
+
- web3
|
| 11 |
+
- solidityscan
|
| 12 |
+
- credshields
|
| 13 |
+
---
|
| 14 |
# Solidity-CodeGen-v0.1
|
| 15 |
|
| 16 |
Solidity-CodeGen-v0.1 is a fine-tuned LLM specialized for generating Solidity smart contracts with modern OpenZeppelin patterns. It works best when paired with the OpenZeppelin Contracts MCP (Model Context Protocol) to produce canonical ERC and Governor implementations.
|
|
|
|
| 21 |
|
| 22 |
## How to Load
|
| 23 |
Transformers:
|
| 24 |
+
```
|
| 25 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 26 |
tok = AutoTokenizer.from_pretrained("credshields/Solidity-CodeGen-v0.1")
|
| 27 |
model = AutoModelForCausalLM.from_pretrained("credshields/Solidity-CodeGen-v0.1", torch_dtype="auto", device_map="auto")
|
| 28 |
+
```
|
| 29 |
|
| 30 |
vLLM:
|
| 31 |
+
```vllm serve YOUR_ORG/Solidity-CodeGen-v0.1 --dtype auto --port 8005```
|
| 32 |
|
| 33 |
|
| 34 |
## Recommended: Use OpenZeppelin MCP (Locally)
|
|
|
|
| 43 |
When MCP is unavailable, use structured prompts:
|
| 44 |
|
| 45 |
- Start with:
|
| 46 |
+
```
|
| 47 |
- “Generate only Solidity code in a single ```
|
| 48 |
- “Solidity: ^0.8.27 and OpenZeppelin v5 imports only (@openzeppelin/contracts/...).”
|
| 49 |
- Specify contract type, features, and constraints.
|
| 50 |
+
```
|
| 51 |
|
| 52 |
Example (ERC20 minimal, mintable):
|
| 53 |
+
```
|
| 54 |
Generate only Solidity code in a single ```
|
| 55 |
Solidity: ^0.8.27, OpenZeppelin v5 imports only.
|
| 56 |
Contract: ERC20 token
|
|
|
|
| 61 |
Imports: ERC20, Ownable
|
| 62 |
constructor(address initialOwner) and Ownable(initialOwner)
|
| 63 |
No burn, no pause, no permit
|
| 64 |
+
```
|
| 65 |
|
| 66 |
## Quality and Limitations
|
| 67 |
- With MCP: ERC20/721/1155 and Governor scaffolds are canonical; custom templates are solid but require review.
|
|
|
|
| 78 |
- Generated code: user responsibility; OpenZeppelin Contracts are MIT-licensed.
|
| 79 |
|
| 80 |
## Note
|
| 81 |
+
Note: This preview focuses on tailored scaffolds for common patterns and may omit end‑to‑end features; treat outputs as starting points to be completed, validated, and audited.
|