Instructions to use XHToken/Spark-X2.6-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XHToken/Spark-X2.6-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XHToken/Spark-X2.6-4B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("XHToken/Spark-X2.6-4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XHToken/Spark-X2.6-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XHToken/Spark-X2.6-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XHToken/Spark-X2.6-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XHToken/Spark-X2.6-4B
- SGLang
How to use XHToken/Spark-X2.6-4B 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 "XHToken/Spark-X2.6-4B" \ --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": "XHToken/Spark-X2.6-4B", "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 "XHToken/Spark-X2.6-4B" \ --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": "XHToken/Spark-X2.6-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use XHToken/Spark-X2.6-4B with Docker Model Runner:
docker model run hf.co/XHToken/Spark-X2.6-4B
[HER Hack-Astron # 7] [Open Source AI for Good] Agentic Fashion
Project name and track
Project name: Agentic Fashion
Track: Agentic Coding
Who this helps and what problem it solves
Target users:
Independent developers and designers building web applications with limited hardware resources.
Small businesses and entrepreneurs who need a website or online storefront without a large development budget.
Developers exploring local AI models and agentic coding workflows.
Concrete scenario and problem:
Building a polished, multi-page e-commerce website usually requires significant development time, frontend expertise, and access to capable AI coding tools or cloud infrastructure.
Agentic Fashion demonstrates an alternative: using a compact language model running locally on a GPU with only 6 GB of VRAM, combined with a custom agent harness, to build a complete fashion storefront.
The project explores how far a small local model can go when the development workflow is designed around its capabilities and constraints.
Expected public benefit:
The project demonstrates that useful AI-assisted software development does not necessarily require expensive hardware or continuous reliance on cloud-hosted models. It provides a practical example of local AI-assisted development for developers and small teams.
How Spark-X2.6-4B is used
Model source and revision:
- Official model: XHToken/Spark-X2.6-4B on Hugging Face.
- Model variant: Spark-X2.6-4B-GGUF, run locally.
- Quantization: 8-bit (Q8).
- Context used: approximately 56K tokens.
The model's role in the application:
Spark-X2.6-4B was the primary coding model used to develop Agentic Fashion. It generated and iteratively refined the application's page structure, UI components, styling, and frontend implementation.
The key enabling component is a custom agent harness that orchestrates the development workflow and helps turn the model's output into a cohesive multi-page application.
Instead of relying on a single code-generation response, the workflow uses a task-oriented development process to build and refine the website.
The model runs locally during development. It is not required to serve the deployed website or generate content for visitors at runtime.
Other models, tools, or services used, if any:
- Custom harness.
- Custom llama.cpp manager
- Astro for the frontend framework.
- Bun for the development environment.
- GitHub for source code.
- Vercel for deployment.
No other AI model was intentionally used as the primary code-generation model for this project.
Demo (required: video OR illustrated walkthrough)
Initial prompt
Iterative prompts
Exit model output
Video link / embedded screenshots:



🚀 Live demo: https://spark-2-6-4b-demo.vercel.app/
Code repository: https://github.com/8clever/spark-2.6-4b-demo
Example input:
Goal
- You are the UI/UX designer and lead developer of "Agentic Fashion".
- Create 5 pages for the "Agentic Fashion" online store, featuring product listings.
- Design a modern, visually appealing, and user-friendly shopping experience.
- Ensure consistent styling, intuitive navigation, and responsive layouts across all pages.
- Use high-quality product imagery, clear typography, and attractive product cards.
- Make the pages feel like a cohesive, production-ready e-commerce website.
Application workflow and actual output:
- The developer provides the project goals and UI requirements to the custom harness.
- Spark-X2.6-4B generates and iteratively refines the website code locally.
- The generated application is structured as an Astro project.
- The resulting website is built and deployed to Vercel.
The final demo includes a fashion storefront with a homepage, product catalog, category navigation, featured products, sale listings, a blog section, and an About page.
How to reproduce
Code repository or runnable example, if available:
https://github.com/8clever/spark-2.6-4b-demo
Setup and run instructions:
Clone the repository and enter the application directory
bun install
bun run dev
Runtime and versions:
Bun: 1.4.3
Astro: 7.4.2
Hardware and precision/quantization:
- GPU memory: 6 GB VRAM.
- Model: Spark-X2.6-4B Q8.
- Quantization: 8-bit.
- Observed generation speed: approximately 10–30 tokens per second.
- Context used: approximately 56K tokens.
- Inference: local execution on the development machine.
Key prompts and inference settings:
The core instruction defines the model as the UI/UX designer and primary developer of Agentic Fashion, with responsibility for building a consistent multi-page fashion storefront.
The workflow is organized around iterative frontend implementation and refinement. The model is run with Q8 quantization and a context of approximately 56K tokens.
The application can be reproduced from the repository using the instructions above. Reproducing the original AI-driven generation workflow additionally requires the custom harness and local model setup.
Results and limitations
Observed results and how they were evaluated:
- A multi-page fashion storefront was generated with local AI-assisted development.
- The application was successfully deployed and made publicly accessible.
- The model operated in a constrained environment with 6 GB of GPU memory.
- Observed generation speed ranged from approximately 10 to 30 tokens per second.
- The development workflow used a context of approximately 56K tokens.
Evaluation was qualitative: the result is an inspectable, deployed website rather than a benchmark-only demonstration. No standardized comparison against larger models or alternative coding agents has been conducted.
Failure cases and current limitations:
- The website is a frontend prototype rather than a production-ready e-commerce platform.
- Product listings and other storefront content are demonstration content; backend inventory, real checkout, payments, and order management are not implemented as production services.
- Generated code can require further iteration and developer review.
- Generation speed and output quality depend on the available hardware, inference runtime, context size, and task complexity.
Contributors and disclosure
Individual / team:
Individual
Contributor profiles and respective contributions:
https://github.com/8clever
AI-assisted development disclosure:
Spark-X2.6-4B Q8 was used as the primary model for generating and refining application code. A custom harness supported the coding workflow.
Data sources and authorization, if applicable:
The project is a frontend demonstration and does not rely on a training dataset or model fine-tuning. Product names, prices, and listings are illustrative storefront content. Product imagery and any third-party assets remain subject to their respective source licenses and attribution requirements.