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 Settings
- 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 CLI & Agent Interface
A powerful command-line interface and agent that showcases Stack 2.9 capabilities. Features interactive chat, command execution, voice input, and comprehensive tool support.
Features
- Interactive Chat Mode: Conversational interface with the agent
- Command Execution: Run single commands and get results
- Voice Input Support (requires setup): Speech-to-text interaction
- 37 Built-in Tools: File ops, git, code execution, web search, memory, planning
- Context Awareness: Project scanning and memory integration
- Self-Reflection: Agent evaluates and improves its own responses
- Multi-mode Operation: Chat, command-line, or voice interfaces
Quick Start
Installation
cd /Users/walidsobhi/.openclaw/workspace/stack-2.9
pip install -e .
Basic Usage
Interactive Chat:
stack
Single Command:
stack -c "read README.md"
Execute Specific Tools:
stack -t git_status project_scan
Voice Mode (requires setup):
stack -v
Modes
1. Interactive Chat Mode
Start a conversation with the agent:
stack
Commands in chat mode:
/tools- List tools used in current session/schema- Show tool schemas/context- Show current workspace context/history- Show conversation history/clear- Clear history/voice- Toggle voice input/exit- Exit
2. Command Mode
Execute a single query:
stack -c "list my tasks"
stack -c "search for *.py files"
stack -c "git status"
3. Tool Mode
Execute specific tools directly:
stack -t read project_scan memory_list
4. Voice Mode
Use voice input/output (requires SpeechRecognition and pyttsx3):
pip install SpeechRecognition pyttsx3 pyaudio
stack -v
Tool Categories
File Operations
read- Read file contentswrite- Write to fileedit- Edit file with text replacementsearch- Search for filesgrep- Search patterns in filescopy- Copy files/directoriesmove- Move/rename filesdelete- Delete files
Git Operations
git_status- Get git statusgit_commit- Create commitgit_push- Push to remotegit_pull- Pull from remotegit_branch- Manage branchesgit_log- View commit historygit_diff- Show changes
Code Execution
run- Run shell commandstest- Run tests (pytest)lint- Lint code (ruff/pylint/mypy)format- Format code (ruff/black)typecheck- Type checking (mypy)server- Start development serverinstall- Install dependencies
Web Tools
web_search- Search the webfetch- Fetch URL contentdownload- Download filescheck_url- Check URL accessibilityscreenshot- Take webpage screenshot
Memory & Context
memory_recall- Search memorymemory_save- Save to memorymemory_list- List memory entriescontext_load- Load project contextproject_scan- Scan project structure
Task Planning
create_task- Create a tasklist_tasks- List tasksupdate_task- Update task statusdelete_task- Delete taskcreate_plan- Create execution planexecute_plan- Execute plan
Query Examples
File operations:
- "read main.py"
- "show me the contents of README.md"
- "create a file called notes.txt with 'Hello World'"
Git operations:
- "git status"
- "commit with message 'update'"
- "push to origin main"
Code execution:
- "run pytest"
- "lint the code"
- "format all files"
Web search:
- "search the web for Python async best practices"
- "look up how to use FastAPI"
- "fetch https://example.com"
Memory:
- "remember that the API key is in .env"
- "what do you remember about this project?"
- "list all memories"
Tasks:
- "create task: implement login"
- "list my tasks"
- "complete task abc123"
Architecture
stack-2.9/
βββ stack_cli/
β βββ __init__.py # Package init
β βββ cli.py # CLI entry point
β βββ agent.py # Core agent logic
β βββ tools.py # 37 built-in tools
β βββ context.py # Context management
βββ stack.py # Main entry script
βββ pyproject.toml # Package config
βββ requirements.txt # Dependencies
Setup
- Install dependencies:
pip install -e .
- (Optional) Install voice dependencies:
pip install SpeechRecognition pyttsx3 pyaudio
- Run the CLI:
stack
Customization
- Configure workspace context in
AGENTS.md,SOUL.md,TOOLS.md - Long-term memory stored in
MEMORY.mdandmemory/folder - Session files in
.tasks.jsonand.plans.json
License
MIT