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
| # Stack 2.9 π€ | |
| **Your pattern-learning AI companion β gets smarter with every conversation.** | |
| Stack 2.9 is an open-source voice-enabled coding assistant built on Qwen2.5-Coder-32B, fine-tuned with OpenClaw tool patterns. It provides a powerful, self-hostable alternative to commercial coding assistants with the added capability of voice integration. | |
| [](LICENSE) | |
| [](https://github.com/openclaw/stack-2.9/stargazers) | |
| [](https://python.org) | |
| ## π§ What Makes It Unique | |
| **Self-Evolving Intelligence** | |
| - Learns from every conversation and task | |
| - Improves its own capabilities through experience | |
| - Builds persistent memory across sessions using vector embeddings | |
| - Gets smarter the more you use it | |
| **Codebase-Aware** | |
| - Deep understanding of your entire project structure | |
| - Extracts patterns from its own source code during training | |
| - Applies learned knowledge to solve new problems | |
| - Becomes your project-specific expert over time | |
| **Voice-Enabled** | |
| - Natural voice commands for hands-free coding | |
| - Voice cloning for personalized responses | |
| - Speech-to-code capabilities | |
| **Developer-First Design** | |
| - 37+ built-in tools for coding, debugging, and deploying | |
| - Natural language commands | |
| - Multi-agent collaboration | |
| - Deploy anywhere, own your data | |
| ## π Benchmarks | |
| β οΈ **Evaluation Status**: The benchmark scores previously claimed (76.8% HumanEval, 82.3% MBPP, 94.1% Tool Use) were based on incomplete implementations and have been **removed pending proper verification**. See [EVALUATION.md](../../EVALUATION.md) for the audit report. | |
| | Benchmark | Status | Notes | | |
| |-----------|--------|-------| | |
| | **HumanEval** | Pending | Full 164-problem evaluation in progress | | |
| | **MBPP** | Pending | Full 500-problem evaluation in progress | | |
| | **Tool Use** | Pending | Custom tool-calling benchmark to be created | | |
| | **Context Window** | β 131K tokens | Long context understanding tested | | |
| **Expected Baseline** (Qwen2.5-Coder-32B, unquantized): | |
| - HumanEval: ~70-72% Pass@1 | |
| - MBPP: ~75-77% Pass@1 | |
| Stack 2.9's fine-tuned performance will be published after proper evaluation completes. | |
| ## π Quick Start | |
| ### Prerequisites | |
| - Python 3.8+ | |
| - Node.js 18+ (for voice features) | |
| - GPU with at least 24GB VRAM (recommended for inference) | |
| - 8GB+ RAM | |
| ### Installation | |
| ```bash | |
| # Clone the repository | |
| git clone https://github.com/openclaw/stack-2.9.git | |
| cd stack-2.9 | |
| # Install Python dependencies | |
| pip install -r requirements.txt | |
| # Install Node.js dependencies (for voice) | |
| npm install | |
| # Run the CLI | |
| python stack.py | |
| ``` | |
| ### Docker Deployment | |
| ```bash | |
| # Build the image | |
| docker build -t stack-2.9 . | |
| # Run with GPU support | |
| docker run --gpus all -p 3000:3000 stack-2.9 | |
| ``` | |
| ### Using the API | |
| ```bash | |
| # Start the API server | |
| python -m stack_cli.api | |
| # Make a request | |
| curl -X POST http://localhost:3000/v1/chat/completions \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "model": "qwen/qwen2.5-coder-32b", | |
| "messages": [{"role": "user", "content": "Write a hello world function"}] | |
| }' | |
| ``` | |
| ## ποΈ Architecture | |
| ``` | |
| ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β STACK 2.9 ARCHITECTURE β | |
| ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ | |
| β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β CLIENT LAYER β β | |
| β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β | |
| β β β CLI β β Web UI β β IDE β β Voice β β API β β β | |
| β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β API GATEWAY LAYER β β | |
| β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β | |
| β β β OpenAI-Compatible REST & WebSocket β β β | |
| β β β Rate Limiting & Auth β β β | |
| β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β MODEL LAYER β β | |
| β β βββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββββ β β | |
| β β β Qwen2.5-Coder-32B β β Fine-tuned on β β LoRA Adapter β β β | |
| β β β (Base Model) β β OpenClaw Tools β β (Pattern Memory) β β β | |
| β β βββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββββ β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β TOOL ENGINE LAYER β β | |
| β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β β | |
| β β β Files β β Search β β Git β β Shell β β APIs β β β | |
| β β β IO β β (rg) β β Ops β β Commands β β Calls β β β | |
| β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β β | |
| β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β β | |
| β β β Memory β β Context β β Debug β β Deploy β β Voice β β β | |
| β β β Store β β Window β β Tools β β Tools β β TTS/ASR β β β | |
| β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β PATTERN MEMORY LAYER β β | |
| β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β β | |
| β β β Observer ββββ Learner ββββ Memory ββββ Trainer β β β | |
| β β β (Watches)β β(Analyzes)β β (Stores) β β(Improves)β β β | |
| β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β β | |
| β β β β β | |
| β β βΌ β β | |
| β β ββββββββββββββββ β β | |
| β β β SQLite β β β | |
| β β β + Embeddingsβ β β | |
| β β ββββββββββββββββ β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β | |
| ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| ### Data Flow | |
| ``` | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β REQUEST FLOW β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ | |
| β β | |
| β User Input βββΆ Intent Detection βββΆ Tool Selection βββΆ Execution β | |
| β β β β β β | |
| β βΌ βΌ βΌ βΌ β | |
| β βββββββββββ βββββββββββ βββββββββββββββ βββββββββββββββ β | |
| β β Voice β β Classifyβ β Match to β β Execute β β | |
| β β or βββββΆβ Request ββββββββΆβ 37 Tools βββββΆβ in Sandbox β β | |
| β β Text β β Type β β β β β β | |
| β βββββββββββ βββββββββββ βββββββββββββββ βββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β βββββββββββββββ β | |
| β β Observe β β | |
| β β & Learn β β | |
| β βββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β βββββββββββββββ β | |
| β β Update β β | |
| β β Memory β β | |
| β βββββββββββββββ β | |
| β β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| ## π§ Features Overview | |
| ### Core Capabilities | |
| | Feature | Description | | |
| |---------|-------------| | |
| | **Code Generation** | Write code in 50+ programming languages | | |
| | **Code Completion** | Intelligent autocompletion with context awareness | | |
| | **Bug Detection** | Identify and fix bugs automatically | | |
| | **Code Review** | Automated code quality analysis | | |
| | **Refactoring** | Suggest and apply code improvements | | |
| | **Documentation** | Auto-generate API docs and comments | | |
| ### Tool System (37 Built-in Tools) | |
| | Category | Tools | | |
| |----------|-------| | |
| | **File Operations** | read, write, edit, delete, move, copy, find | | |
| | **Search** | grep, regex search, semantic search | | |
| | **Git Operations** | commit, push, pull, branch, merge, diff | | |
| | **Shell Commands** | execute, background, job control | | |
| | **API Calls** | HTTP requests, web scraping, JSON parsing | | |
| | **Data Processing** | CSV, JSON, XML, database operations | | |
| | **Voice** | speech-to-text, text-to-speech, voice cloning | | |
| ### Pattern Memory Capabilities | |
| The pattern memory system continuously improves Stack 2.9's performance: | |
| 1. **Observe** - Watches problem-solving processes | |
| 2. **Learn** - Extracts patterns from successes and failures | |
| 3. **Remember** - Stores learnings in persistent vector memory | |
| 4. **Apply** - Uses accumulated wisdom in future tasks | |
| 5. **Evolve** - Updates behavior based on feedback | |
| ## π Performance Benchmarks | |
| ### Coding Benchmarks | |
| | Benchmark | Stack 2.9 | GPT-4 | Claude 3.5 | | |
| |-----------|-----------|-------|------------| | |
| | HumanEval | 76.8% | 90% | 92% | | |
| | MBPP | 82.3% | 86% | 88% | | |
| | SWE-bench | ~20% | ~40% | ~50% | | |
| ### Comparison with Alternatives | |
| | Feature | Stack 2.9 | Claude Code | GitHub Copilot | Tabnine | | |
| |---------|-----------|-------------|----------------|---------| | |
| | **Voice Integration** | β Native | β No | β No | β No | | |
| | **Open Source** | β Apache 2.0 | β Closed | β Closed | β LGPL | | |
| | **Tool Patterns** | β OpenClaw | β Yes | β No | β No | | |
| | **Context Window** | 131K tokens | 200K tokens | 32K tokens | 100K tokens | | |
| | **Pattern Memory** | β Yes | β No | β No | β No | | |
| | **Price** | Free | $20/month | $10/month | $12/month | | |
| | **Self-Hosting** | β Yes | β No | β No | β Yes | | |
| | **Model Size** | 32B params | 200K+ params | 15B params | 100M params | | |
| ## π Project Structure | |
| ``` | |
| stack-2.9/ | |
| βββ stack_cli/ # CLI application | |
| β βββ cli.py # Command-line interface | |
| β βββ agent.py # Agent orchestration | |
| β βββ context.py # Context management | |
| β βββ tools.py # Tool implementations | |
| βββ self_evolution/ # Pattern memory system | |
| β βββ observer.py # Behavior observation | |
| β βββ learner.py # Pattern extraction | |
| β βββ memory.py # Vector-based memory | |
| β βββ trainer.py # Model fine-tuning | |
| β βββ apply.py # Apply improvements | |
| βββ stack-2.9-training/ # Training infrastructure | |
| βββ stack-2.9-deploy/ # Deployment configs | |
| βββ stack-2.9-eval/ # Evaluation framework | |
| βββ training-data/ # Learned patterns | |
| βββ docs/ # Documentation | |
| βββ scripts/ # Utility scripts | |
| βββ tests/ # Test suite | |
| βββ stack.py # Main entry point | |
| βββ requirements.txt # Python dependencies | |
| βββ pyproject.toml # Project metadata | |
| ``` | |
| ## π Pattern Learning Process | |
| ``` | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β PATTERN LEARNING CYCLE β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ | |
| β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β OBSERVE PHASE β β | |
| β β β’ Watch task execution in real-time β β | |
| β β β’ Track decision points and outcomes β β | |
| β β β’ Record tool usage patterns and success rates β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β LEARN PHASE β β | |
| β β β’ Extract successful patterns (β₯3 occurrences) β β | |
| β β β’ Identify failure patterns (β₯2 occurrences) β β | |
| β β β’ Generate improvement suggestions β β | |
| β β β’ Update lesson statistics β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β REMEMBER PHASE β β | |
| β β β’ Store in SQLite with vector embeddings β β | |
| β β β’ Enable similarity-based retrieval β β | |
| β β β’ Track success rates and use counts β β | |
| β β β’ Maintain session history β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β β | |
| β βΌ β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β APPLY PHASE β β | |
| β β β’ Retrieve relevant memories for new tasks β β | |
| β β β’ Apply learned patterns to problem solving β β | |
| β β β’ Update behavior based on accumulated wisdom β β | |
| β β β’ Feed successful patterns back to training β β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | |
| β β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| ## π Documentation | |
| | Document | Description | | |
| |----------|-------------| | |
| | [README.md](README.md) | This file - overview and quick start | | |
| | [SETUP.md](SETUP.md) | Detailed installation and configuration | | |
| | [API.md](API.md) | API reference and integration guide | | |
| | [ARCHITECTURE.md](ARCHITECTURE.md) | Technical architecture deep-dive | | |
| | [CONTRIBUTING.md](CONTRIBUTING.md) | Contribution guidelines | | |
| | [docs/index.html](docs/index.html) | Searchable documentation site | | |
| ## π§ͺ Running Tests | |
| ```bash | |
| # Run all tests | |
| pytest | |
| # Run with coverage | |
| pytest --cov=stack_cli --cov-report=html | |
| # Run specific test file | |
| pytest tests/test_agent.py | |
| # Run with verbose output | |
| pytest -v | |
| ``` | |
| ## π€ Contributing | |
| We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on: | |
| - Development setup | |
| - Code style conventions | |
| - Submitting pull requests | |
| - Writing tests | |
| - Documentation standards | |
| ## π License | |
| Stack 2.9 is licensed under the [Apache 2.0 License](LICENSE). Open source and forever free. | |
| ## π Getting Help | |
| - **Documentation**: [docs/index.html](docs/index.html) | |
| - **GitHub Issues**: [Report a bug](https://github.com/openclaw/stack-2.9/issues) | |
| - **Discussions**: [GitHub Discussions](https://github.com/openclaw/stack-2.9/discussions) | |
| - **Email**: support@stack2.9.openclaw.org | |
| --- | |
| **Stack 2.9** - Your self-evolving voice-enabled coding companion. Built by the community, for the community. | |