ASCII-to-Go Coder
A fine-tuned model that generates working Go code from ASCII architecture diagrams.
What it does
Give it an ASCII box diagram describing a system architecture, and it generates complete, compilable Go code implementing that system.
Input:
[Producer] --> [Channel] --> [Worker 1]
--> [Worker 2]
--> [Worker 3]
|
[Results Channel]
|
[Collector]
Output: A complete Go program with goroutines, channels, WaitGroups, and proper shutdown handling.
Training
- Base model: Qwen2.5-Coder-7B-Instruct
- Method: LoRA (r=16, 0.53% of parameters trainable)
- Dataset: 76 hand-written ASCII diagram → Go code pairs
- Training time: ~13 minutes on NVIDIA L4 (24GB)
- Final loss: 0.011
- Token accuracy: 99.8%
Patterns covered
The training data covers real-world Go patterns including: HTTP servers, middleware chains, worker pools, pub/sub, WebSocket chat, reverse proxies, JWT authentication, circuit breakers, LRU caches, ring buffers, tries, priority queues, state machines, event sourcing, SSE streaming, gzip compression, generics, channel pipelines, graceful shutdown, rate limiting, fan-in/fan-out, and more.
How to run
1llama-server \
2 -hf vinod-halaharvi/ascii-to-go-coder \
3 -ngl 999 --host 0.0.0.0 --port 8080 --ctx-size 4096
Then open http://localhost:8080 and paste an ASCII diagram.
Limitations
- Trained on only 76 examples — may struggle with patterns not in the training set
- Generated code compiles but may contain logical bugs in complex scenarios
- Works best with standard library patterns; less reliable with third-party libraries
- This is a learning project, not production-grade
Hardware requirements
- Minimum: 6GB VRAM (Q4_K_M quantization)
- Recommended: NVIDIA GPU with 8GB+ VRAM
- Also runs on: CPU (slower), Apple Silicon (via Metal)