Instructions to use zero-systems/StructuredCoder-7b.GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zero-systems/StructuredCoder-7b.GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zero-systems/StructuredCoder-7b.GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("zero-systems/StructuredCoder-7b.GGUF") model = AutoModelForMultimodalLM.from_pretrained("zero-systems/StructuredCoder-7b.GGUF") - llama-cpp-python
How to use zero-systems/StructuredCoder-7b.GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="zero-systems/StructuredCoder-7b.GGUF", filename="structured_coder_7b_q4_0.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use zero-systems/StructuredCoder-7b.GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf zero-systems/StructuredCoder-7b.GGUF:Q4_0 # Run inference directly in the terminal: llama-cli -hf zero-systems/StructuredCoder-7b.GGUF:Q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf zero-systems/StructuredCoder-7b.GGUF:Q4_0 # Run inference directly in the terminal: llama-cli -hf zero-systems/StructuredCoder-7b.GGUF:Q4_0
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 zero-systems/StructuredCoder-7b.GGUF:Q4_0 # Run inference directly in the terminal: ./llama-cli -hf zero-systems/StructuredCoder-7b.GGUF:Q4_0
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 zero-systems/StructuredCoder-7b.GGUF:Q4_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf zero-systems/StructuredCoder-7b.GGUF:Q4_0
Use Docker
docker model run hf.co/zero-systems/StructuredCoder-7b.GGUF:Q4_0
- LM Studio
- Jan
- vLLM
How to use zero-systems/StructuredCoder-7b.GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zero-systems/StructuredCoder-7b.GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zero-systems/StructuredCoder-7b.GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zero-systems/StructuredCoder-7b.GGUF:Q4_0
- SGLang
How to use zero-systems/StructuredCoder-7b.GGUF 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 "zero-systems/StructuredCoder-7b.GGUF" \ --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": "zero-systems/StructuredCoder-7b.GGUF", "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 "zero-systems/StructuredCoder-7b.GGUF" \ --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": "zero-systems/StructuredCoder-7b.GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use zero-systems/StructuredCoder-7b.GGUF with Ollama:
ollama run hf.co/zero-systems/StructuredCoder-7b.GGUF:Q4_0
- Unsloth Studio
How to use zero-systems/StructuredCoder-7b.GGUF 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 zero-systems/StructuredCoder-7b.GGUF 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 zero-systems/StructuredCoder-7b.GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for zero-systems/StructuredCoder-7b.GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use zero-systems/StructuredCoder-7b.GGUF with Docker Model Runner:
docker model run hf.co/zero-systems/StructuredCoder-7b.GGUF:Q4_0
- Lemonade
How to use zero-systems/StructuredCoder-7b.GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull zero-systems/StructuredCoder-7b.GGUF:Q4_0
Run and chat with the model
lemonade run user.StructuredCoder-7b.GGUF-Q4_0
List all available models
lemonade list
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="zero-systems/StructuredCoder-7b.GGUF")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages)# Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("zero-systems/StructuredCoder-7b.GGUF")
model = AutoModelForMultimodalLM.from_pretrained("zero-systems/StructuredCoder-7b.GGUF")StructuredCoder-7b.GGUF
StructuredCoder models aim to identify formats of data represented within sets of strings, and convert strings of set A to the format of set B via generated Python code.
Model Details
Model Description
- Model type: LLM
- Finetuned from model [optional]: deepseek-ai/deepseek-coder-6.7b-instruct
Inference
.gguf models can be inferenced using llama.cpp (llama-cpp-python).
Please follow the instructions within these repos to get started.
Inference Examples
This is an instruct finetune utilizing the Alpaca instruct format (introduced by stanford-alpaca):
"{system_prompt}\n\n### Instruction:\n{instruction}\n\n### Response: "
The model is finetuned to perform the following task:
Structured Data Conversion
Expected input:
You are a coding assistant that specializes in converting string values from an input to a target format.
You will be given a set of input sets, each in itself a set of example string values plus a corresponding title, as well as a set of example target strings plus a corresponding title.
Your task is to analyze the string formats and identify whether or not the input sets can be converted into the target set using a single Python method, and then to write that method.
You will also be given a short piece of context that may be helpful to arrive at your decision.
### Instruction:
Input Sets:
Title: OldPlanServiceRate
Example Values:
[
"$50.15"
"$70.10"
"$90.30"
"$44.20"
"$50.10"
"$90.36"
]
Title: OldPlanQuantity
Example Values:
[
"5"
"5"
"2"
"4"
"2"
"8"
]
Target Set:
Title: OldPlanServiceAmount
Example Values:
[
"$75.30"
"$325.90"
"$175.80"
"$150.75"
"$525.50"
"$400.50"
]
Context:
1. The target key suggests a monetary amount related to an 'Old Plan' service. 2. The values of the target data are monetary amounts formatted as currency. 3. 'OldPlanServiceRate' provides a monetary rate for a service and 'OldPlanQuantity' specifies a quantity, which when multiplied together, would give a monetary amount similar to the values present in 'OldPlanServiceAmount'.
### Response:
Expected Output:
{
"reasoning": "Remove the dollar sign from OldPlanServiceRate, convert it to a float and OldPlanQuantity to an integer. Then multiply the two together to get the service amount. The result should be formatted as a currency string with two decimal places and a dollar sign.",
"test_input_values": {
"OldPlanServiceRate": "$50.25",
"OldPlanQuantity": "10"
},
"test_expected_output_value": "$502.50",
"conversion_code": "def convert(old_plan_service_rate: str, old_plan_quantity: str) -> str:\n import re\n service_rate = float(re.sub('[$]', '', old_plan_service_rate))\n quantity = int(old_plan_quantity)\n return '${:.2f}'.format(service_rate * quantity)"
}
Training Data
zero-systems/StringConversion.7k.INSTRUCT_DPO
Training Methodology
StructuredLLM was trained using QLoRA.
Resulting adapter was merged into the base model weights, converted to the gguf format and finally quantized to 4 bits.
- Downloads last month
- -
4-bit
# Gated model: Login with a HF token with gated access permission hf auth login