You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

🌟 Vedalytics Gemma 4 (E4B) — Chemistry & Spectroscopy Specialized Model

An expert language model fine-tuned for chemistry, NMR, IR, mass spectrometry, and spectroscopy, optimized for enterprise efficiency on both CPU and GPU.


🎯 Model Overview & Capabilities

Vedalytics Gemma 4 is a 4-billion parameter transformer model built on Google's Gemma architecture (Gemma 4-E4B), enhanced with high-precision quantization and enterprise-grade fine-tuning.

The model is specialized for:

  • Organic Chemistry, Inorganic Chemistry, Analytical Chemistry
  • Nuclear Magnetic Resonance (¹H, ¹³C, 2D NMR)
  • Infrared (IR) and Raman Spectroscopy
  • UV-Visible (UV-Vis) and Fluorescence Spectroscopy
  • Mass Spectrometry (MS, LC-MS, GC-MS)
  • Reaction Mechanisms, Synthesis, and Spectroscopy Interpretation

Key features:

  • Domain-Specific Expertise: Trained on 5,000+ chemistry-focused Q&A pairs with industry terminology.
  • Guardrails & Safety: Automatically rejects out-of-domain queries (e.g., general knowledge, history, programming) to maintain scientific integrity.
  • Optimized for Inference:
    • CPU: 4-bit or 8-bit quantization for high performance on standard Intel/AMD hardware.
    • GPU: Full 16-bit or 32-bit precision with Tensor Core acceleration on NVIDIA/DGX systems.
    • Mac Metal: Metal Performance Shaders support for optimal Apple Silicon (M1/M2/M3/M4) performance.

The fine-tuned model is constrained to only respond to questions regarding Chemistry and Spectroscopy (organic/inorganic/analytical chemistry, NMR, IR, UV-Vis, Mass Spectrometry, Raman, etc.) and politely reject out-of-domain queries.


🚀 How to Get Started

Using Merged Model (PyTorch / Transformers)

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "./merged_model"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

prompt = "Explain chemical shift in 1H NMR spectroscopy."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    outputs = model.generate(**inputs, max_new_tokens=256)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Using GGUF with Ollama or llama.cpp

# Run with Ollama
ollama run gemma-chem

# Run with llama.cpp
./llama-cli -m ./output_gguf/vedalytics-gemma4E4B-chemistry.gguf -t 8 -p "What is the IR peak for an alkyne group?"

🌐 Cross-Platform Deployment Guide (CPU, Mac Mini & DGX Spark)

1. Standard CPU Deployment (x86_64 / Intel / AMD)

  • Compatibility: 100% Supported (No GPU required).
  • Execution: The exported GGUF model uses llama.cpp AVX2 / AVX-512 CPU thread vectorization.
  • Commands:
    • Ollama CPU: ollama run gemma-chem
    • llama.cpp CLI:
      ./llama-cli -m ./output_gguf/vedalytics-gemma4E4B-chemistry.gguf -t 8 -p "Explain chemical shift in 1H NMR."
      

2. Apple Silicon Mac Mini (M1 / M2 / M3 / M4)

  • Compatibility: 100% Supported with Metal & Unified Memory Acceleration.
  • Performance: High inference speed (~40–70 tokens/sec) utilizing macOS Metal Performance Shaders (MPS).
  • Commands:
    • Ollama Mac:
      ollama create gemma-chem -f Modelfile
      ollama run gemma-chem
      
    • llama.cpp (Metal):
      ./llama-cli -m ./output_gguf/vedalytics-gemma4E4B-chemistry.gguf -ngl 99 -p "What is the IR peak for an alkyne?"
      

3. NVIDIA DGX / Spark GPU Clusters

  • Compatibility: 100% Supported with Enterprise CUDA / Tensor Core acceleration.
  • Deployment:
    • vLLM / Hugging Face: Deploy merged_model/ for multi-user REST API endpoints:
      from transformers import AutoModelForCausalLM, AutoTokenizer
      model = AutoModelForCausalLM.from_pretrained("./merged_model", device_map="cuda")
      
    • Ollama / llama.cpp (CUDA): Load .gguf file with 100% CUDA layer offloading (-ngl 99).

📊 Cross-Platform Feature Comparison Matrix

Environment Acceleration Engine Est. Speed Recommended Format
Standard CPU CPU AVX2 / AVX-512 ~15 – 30 tokens/sec GGUF (f16 or q4_k_m)
Mac Mini (Apple Silicon) Apple Metal (Unified RAM) ~40 – 70 tokens/sec GGUF (f16 or q8_0)
NVIDIA DGX / Spark Cluster CUDA / Tensor Cores ~100+ tokens/sec Merged Model (merged_model) or GGUF

🛠️ Framework Versions

  • PEFT: 0.20.0
  • TRL: 1.10.0
  • Transformers: 5.16.1
  • PyTorch: 2.11.0
Downloads last month
-
GGUF
Model size
7B params
Architecture
gemma4
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for karunakant/vedalytics-gemma4E4B-chemistry

Adapter
(487)
this model