Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
The size of the content of the first rows (225782 B) exceeds the maximum supported size (200000 B) even after truncation. Please report the issue.
Error code:   TooBigContentError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Safetensors Studio & Bench

Run, test, and benchmark local Safetensors models with surgical VRAM observability.

Next.js FastAPI Python License: MIT Hugging Face

Safetensors Studio & Bench is a full-stack, local-first platform to load any *.safetensors + config.json + tokenizer.json folder, stream chat with real TPS/TTFT, run automated benchmarks (Reasoning/Coding/Arabic/Summarization), and profile GPU/CPU/RAM live β€” no cloud required.

πŸ“– Arabic README: README_AR.md | πŸ“š Docs: docs/ | 🀝 Contribute: CONTRIBUTING.md


✨ Key Features

Area What you get
Safetensors Loader Local folder picker β€’ Float16 / Bfloat16 / Float32 β€’ 4-bit NF4 / 8-bit via bitsandbytes β€’ device_map: auto / balanced / cpu / cuda:0 + offloading
Live Playground Token Streaming (SSE) β€’ Real Tokens/sec & TTFT β€’ Temperature / Top-P / Max Tokens β€’ Copy & clear
Automated Benchmark 15 preset tasks: Reasoning (4), Coding (4), Arabic Quality (4), Summarization (3) β€’ Exact / Regex / LLM-as-Judge β€’ Custom datasets: drop any folder with .csv/.json/.jsonl/.txt/.md β†’ auto-detects language (Arabic/English) & category
Hardware Profiling pynvml + psutil β†’ live VRAM/CPU/RAM/Power via Recharts β€’ VRAM peak timeline β€’ TPS vs VRAM scatter β€’ 600-point history
Reports & Sharing Export PDF (Arabic-capable) / JSON / CSV β€’ Shareable link /share/{token} β€’ Full tables + by_category insights

🌍 Supported Languages

Language Coverage
English UI, prompts, docs, code, benchmarks (Reasoning, Coding, Summarization)
Arabic (Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©) Full UI RTL, benchmarks (Arabic Quality, Summarization), PDF with tahoma.ttf + arabic-reshaper, auto-detection \u0600-\u06FF for custom datasets
Mixed Auto language_counts: {ar, en} per folder, per report

Add a new language: add prompts to backend/app/benchmark.py:14 and categories to dataset_parser.py:11. See SUPPORTED_LANGUAGES.md.


πŸš€ Quick Start

1. Requirements

  • Node 22+ / Python 3.12+
  • 8GB RAM minimum (CPU mode), 12GB+ VRAM recommended for 7B models on GPU

2. Backend

cd backend
pip install -r requirements.txt          # torch CPU + transformers are included
# optional GPU: pip install torch --index-url https://download.pytorch.org/whl/cu121
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# β†’ http://localhost:8000/docs

3. Frontend

cd frontend
npm install
npm run dev
# β†’ http://localhost:3000
# env: frontend/.env.local β†’ NEXT_PUBLIC_API_URL=http://localhost:8000

4. Docker (alternative)

docker compose up --build
# frontend http://localhost:3000  backend http://localhost:8000

5. Load a model

  • Place a HF-style folder anywhere, e.g. C:\models\mistral-7b containing model.safetensors, config.json, tokenizer.json
  • In UI / or /models or new: top bar of /benchmark β†’ paste path β†’ Validate β†’ Load
  • Or via API: POST /api/model/load {"model_path":"C:\\models\\my-model","dtype":"float16","quantization":"4bit","device_map":"auto"}

No GPU? The platform auto-enters Demo Mode (simulated generation) so you can still test all features.


πŸ“ Project Structure

backend/app/
  main.py                 # FastAPI + CORS + routers
  model_manager.py        # Safetensors loader (torch dtype/quant/device_map)
  telemetry.py            # pynvml/psutil + 600-point history
  benchmark.py            # 15 tasks + evaluate_answer()
  dataset_parser.py       # CSV/JSON/JSONL/TXT/MD β†’ BenchmarkTask + lang detect
  schemas.py
  routers/{model,inference,telemetry,benchmark,custom_benchmark,share,export}.py
frontend/src/
  app/{page, playground, benchmark, hardware, models, share/[token]}
  components/{ModelLoader, ModelPathSelector, Playground, BenchmarkPanel, CustomDatasetPanel, TelemetryCharts}
  lib/{api.ts, utils.ts}
example_dataset/          # 9-task mixed sample (AR/EN)
docs/                     # English developer docs

πŸ”Œ API Reference (core)

Method Path Description
POST /api/model/load Load Safetensors folder
GET /api/model/status Loaded info
GET /api/model/validate?path= Check *.safetensors + config.json
POST /api/generate (SSE) Stream tokens with ttft_ms, tokens_per_sec
GET /api/telemetry/ Snapshot (VRAM/GPU/CPU/RAM)
WS /ws/telemetry Live push (fallback to HTTP polling)
POST /api/benchmark/run Sync benchmark (blocking)
POST /api/benchmark/run-stream SSE progress (type: progress/task_done/done)
POST /api/benchmark/custom/scan?folder_path= Scan custom folder
POST /api/benchmark/custom/run-from-folder Run on custom folder
POST /api/benchmark/custom/upload Multipart upload
POST /api/share/{report_id} Create share token
GET /api/share/{token} Fetch shared report
GET /api/export/{json,csv,pdf}?report_id= Export

Full spec: http://localhost:8000/docs


πŸ§ͺ Benchmark Suites

Suite Tasks Judge
reasoning arithmetic, sequence, logic puzzle, fraction Regex \b7\b
coding fibonacci, loop output, reverse_string, sorted Regex def\s+
arabic spelling, synonym, i'rab, summarization Regex Ψ°Ω‡Ψ¨Ψͺ, فرح
summarization tech text, Transformer, bullet points Regex 7 Ω…Ω„ΩŠΨ§Ψ±

Custom folder example (CSV):

prompt,expected,expected_regex,category,name
"Ω…Ψ§ مرادف سعيد؟",فرح,فرح,arabic,syn

πŸ“Š Hardware Profiling

  • telemetry.py:19 polls pynvml.nvmlDeviceGetMemoryInfo + psutil.virtual_memory every 1.2s
  • Recharts Area/Line/Scatter: VRAM timeline, CPU/RAM %, Power vs VRAM, TPS vs VRAM
  • vram_peak_mb tracked per task and globally

πŸ“„ Export & Sharing

  • PDF: Unicode via tahoma.ttf + arabic-reshaper + python-bidi (fallback to ? sanitization)
  • Share: in-memory share_store[token]=report_id β†’ /share/{token} page

πŸ› οΈ Development

See docs/DEVELOPMENT.md and docs/ARCHITECTURE.md.

# Frontend
npm run build   # production
npm run lint

# Backend
python -m pytest  # (add tests)
pip install -r requirements.txt

πŸ€— Hugging Face

  • Use any HF model: download snapshots and point model_path to it.
  • Model card template: docs/HUGGINGFACE.md
  • Dataset parser auto-handles HF datasets exported as JSONL/CSV.

🀝 Contributing

Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md. PRs for new languages, benchmarks, and quant backends are welcome!

πŸ”’ Security

See SECURITY.md.

πŸ“ License

MIT β€” see LICENSE.


Built with ❀️ for local AI β€” no cloud, full control.

Downloads last month
7