Text Generation
Transformers
English
qwen2
code-generation
python
fine-tuning
Qwen
tools
agent-framework
multi-agent
conversational
Eval Results (legacy)
Instructions to use my-ai-stack/Stack-2-9-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use my-ai-stack/Stack-2-9-finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="my-ai-stack/Stack-2-9-finetuned") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("my-ai-stack/Stack-2-9-finetuned") model = AutoModelForCausalLM.from_pretrained("my-ai-stack/Stack-2-9-finetuned") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use my-ai-stack/Stack-2-9-finetuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "my-ai-stack/Stack-2-9-finetuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "my-ai-stack/Stack-2-9-finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/my-ai-stack/Stack-2-9-finetuned
- SGLang
How to use my-ai-stack/Stack-2-9-finetuned with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "my-ai-stack/Stack-2-9-finetuned" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "my-ai-stack/Stack-2-9-finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "my-ai-stack/Stack-2-9-finetuned" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "my-ai-stack/Stack-2-9-finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use my-ai-stack/Stack-2-9-finetuned with Docker Model Runner:
docker model run hf.co/my-ai-stack/Stack-2-9-finetuned
File size: 3,305 Bytes
b03a8a0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | # Stack 2.9 β Quick Start
> **AI coding assistant powered by Qwen2.5-Coder-32B with Pattern Memory.**
```
git clone https://github.com/my-ai-stack/stack-2.9.git
cd stack-2.9
pip install -r requirements.txt
cp .env.example .env
python stack.py
```
That's it. Keep reading for details.
---
## Prerequisites
- **Python 3.10+**
- **GPU** (optional β runs on CPU via cloud providers too)
- **Git**
---
## Install & Run
```bash
# Clone
git clone https://github.com/my-ai-stack/stack-2.9.git
cd stack-2.9
# Install
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# Configure (pick a provider below, then edit .env)
cp .env.example .env
# Run!
python stack.py
```
---
## Configure Your Model Provider
Edit `.env` with one of these:
### Ollama (Local, Private) β Recommended
```env
MODEL_PROVIDER=ollama
OLLAMA_MODEL=qwen2.5-coder:32b
```
```bash
# First: curl -fsSL https://ollama.ai/install.sh | sh && ollama pull qwen2.5-coder:32b
```
### Together AI (Cloud, Fast)
```env
MODEL_PROVIDER=together
TOGETHER_API_KEY=tog-your-key-here
TOGETHER_MODEL=togethercomputer/qwen2.5-32b-instruct
```
### OpenAI (GPT-4o)
```env
MODEL_PROVIDER=openai
OPENAI_API_KEY=sk-your-key-here
OPENAI_MODEL=gpt-4o
```
### Anthropic (Claude)
```env
MODEL_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-your-key-here
ANTHROPIC_MODEL=claude-3-5-sonnet-20240229
```
---
## Usage
### Interactive Chat
```bash
python stack.py
```
### Single Query
```bash
python stack.py -c "Write a Python function to reverse a string"
```
### Evaluate Model (GPU required)
```bash
python evaluate_model.py --model-path ./output/merged --benchmark humaneval
```
### Deploy with Docker
```bash
docker build -t stack-2.9 . && docker run -p 7860:7860 stack-2.9
```
---
## 5-Minute Overview
| Feature | Command |
|---------|---------|
| Start chatting | `python stack.py` |
| Ask one question | `python stack.py -c "your question"` |
| Run benchmarks | `python evaluate_model.py --model-path ./merged --benchmark both` |
| List patterns | `python stack.py --patterns list` |
| Deploy locally | `docker build -t stack-2.9 . && docker run -p 7860:7860 stack-2.9` |
---
## Hardware Requirements
| Model | Minimum | Recommended |
|-------|---------|------------|
| 7B | RTX 3060 (6GB) | A100 40GB |
| 32B | RTX 3090 (24GB) | A100 80GB |
No GPU? Use Ollama on your machine or any cloud provider in `.env`.
---
## Key Links
- π **Full docs:** [docs/QUICKSTART.md](docs/QUICKSTART.md)
- π§ **46 tools:** [TOOLS.md](TOOLS.md)
- π§ **Pattern memory:** [docs/pattern-moat.md](docs/pattern-moat.md)
- π **Training guide:** [docs/TRAINING_7B.md](docs/TRAINING_7B.md)
- π³ **Kubernetes:** [k8s/](k8s/)
---
## What's Inside
- **Qwen2.5-Coder-32B** β 32B parameter code-specialized model
- **Pattern Memory** β learns from successful interactions
- **46 built-in tools** β file ops, git, shell, search, memory, tasks
- **Multi-provider** β Ollama, OpenAI, Anthropic, Together AI, OpenRouter
- **128K context** β handles large codebases
- **Self-hosted** β full control, private
- **MCP support** β integrates with any Model Context Protocol server
- **Voice-ready** β Coqui XTTS for voice cloning
---
*Built with β€οΈ for developers who want an AI that grows with them.*
|