Instructions to use mishl/Regex-AI-Llama-3.2-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use mishl/Regex-AI-Llama-3.2-1B with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="mishl/Regex-AI-Llama-3.2-1B", filename="unsloth.F16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use mishl/Regex-AI-Llama-3.2-1B with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf mishl/Regex-AI-Llama-3.2-1B:F16 # Run inference directly in the terminal: llama-cli -hf mishl/Regex-AI-Llama-3.2-1B:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf mishl/Regex-AI-Llama-3.2-1B:F16 # Run inference directly in the terminal: llama-cli -hf mishl/Regex-AI-Llama-3.2-1B:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf mishl/Regex-AI-Llama-3.2-1B:F16 # Run inference directly in the terminal: ./llama-cli -hf mishl/Regex-AI-Llama-3.2-1B:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf mishl/Regex-AI-Llama-3.2-1B:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf mishl/Regex-AI-Llama-3.2-1B:F16
Use Docker
docker model run hf.co/mishl/Regex-AI-Llama-3.2-1B:F16
- LM Studio
- Jan
- vLLM
How to use mishl/Regex-AI-Llama-3.2-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mishl/Regex-AI-Llama-3.2-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mishl/Regex-AI-Llama-3.2-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mishl/Regex-AI-Llama-3.2-1B:F16
- Ollama
How to use mishl/Regex-AI-Llama-3.2-1B with Ollama:
ollama run hf.co/mishl/Regex-AI-Llama-3.2-1B:F16
- Unsloth Studio new
How to use mishl/Regex-AI-Llama-3.2-1B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for mishl/Regex-AI-Llama-3.2-1B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for mishl/Regex-AI-Llama-3.2-1B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for mishl/Regex-AI-Llama-3.2-1B to start chatting
- Pi new
How to use mishl/Regex-AI-Llama-3.2-1B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf mishl/Regex-AI-Llama-3.2-1B:F16
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mishl/Regex-AI-Llama-3.2-1B:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mishl/Regex-AI-Llama-3.2-1B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf mishl/Regex-AI-Llama-3.2-1B:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mishl/Regex-AI-Llama-3.2-1B:F16
Run Hermes
hermes
- Docker Model Runner
How to use mishl/Regex-AI-Llama-3.2-1B with Docker Model Runner:
docker model run hf.co/mishl/Regex-AI-Llama-3.2-1B:F16
- Lemonade
How to use mishl/Regex-AI-Llama-3.2-1B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mishl/Regex-AI-Llama-3.2-1B:F16
Run and chat with the model
lemonade run user.Regex-AI-Llama-3.2-1B-F16
List all available models
lemonade list
Regex-AI-Llama-3.2-1B
This model is a fine-tuned version of meta-llama/Llama-3.2-1B-Instruct specifically trained on the phongo/RegEx dataset for generating regular expressions. It aims to provide accurate and efficient regex solutions based on natural language descriptions of the desired pattern.
Model Description
- Architecture: This model leverages the Llama-3.2-1B architecture, a powerful language model developed by Meta. It's been further specialized for regex generation through fine-tuning.
- Training Data: The model was trained on the
phongo/RegExdataset, which contains pairs of natural language descriptions and corresponding regular expressions. - Fine-tuning: The base Llama model was fine-tuned using a supervised learning approach on the regex dataset. Specific training details (e.g., hyperparameters, training duration) are not available but assumed to be standard fine-tuning practices.
- Intended Use: This model is intended to assist users in generating regular expressions. It is particularly helpful for users who may be less familiar with regex syntax or need help translating a complex textual description into a working regex pattern.
Intended uses & limitations
This model is intended for generating regular expressions based on natural language descriptions. While it strives for accuracy, it's important to test the generated regex thoroughly. Like all language models, it may occasionally produce incorrect or suboptimal results. The model is not responsible for the usage of the generated regexes.
Limitations:
- Complexity: The model may struggle with extremely complex or nuanced regex patterns.
- Ambiguity: Ambiguous natural language descriptions can lead to inaccurate regexes. Be as precise and clear as possible in your prompts.
- Edge Cases: The model might not cover all possible edge cases in regex syntax.
- Security: Always validate and sanitize generated regexes before using them in production environments to prevent potential security vulnerabilities (e.g., ReDoS attacks).
How to use
You can use this model with the following code:
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="mishl/Regex-AI-Llama-3.2-1B",
filename="unsloth.Q4_K_M.gguf", # Or unsloth.F16.gguf
)
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "Create regex for masked links like this [website](www.example.com)"
}
]
)
- Downloads last month
- 879
4-bit
16-bit
Model tree for mishl/Regex-AI-Llama-3.2-1B
Base model
meta-llama/Llama-3.2-1B-Instruct