Instructions to use onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF", dtype="auto") - llama-cpp-python
How to use onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF", filename="OneSQL-v0.1-Qwen-7B-Q2_K.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use onekq-ai/OneSQL-v0.1-Qwen-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 onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
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 onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
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 onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF with Ollama:
ollama run hf.co/onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
- Unsloth Studio new
How to use onekq-ai/OneSQL-v0.1-Qwen-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 onekq-ai/OneSQL-v0.1-Qwen-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 onekq-ai/OneSQL-v0.1-Qwen-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 onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF to start chatting
- Pi new
How to use onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
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": "onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
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 onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF with Docker Model Runner:
docker model run hf.co/onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
- Lemonade
How to use onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull onekq-ai/OneSQL-v0.1-Qwen-7B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.OneSQL-v0.1-Qwen-7B-GGUF-Q4_K_M
List all available models
lemonade list
Example prompt and response here
Prompt
My table
Table "public.usersdefaults"
┌────────────────────────────────────────┬──────────────────────────┬───────────┬──────────┬──────────────────────────────────┐
│ Column │ Type │ Collation │ Nullable │ Default │
├────────────────────────────────────────┼──────────────────────────┼───────────┼──────────┼──────────────────────────────────┤
│ usersdefaults_id │ integer │ │ not null │ generated by default as identity │
│ usersdefaults_datecreated │ timestamp with time zone │ │ not null │ CURRENT_TIMESTAMP │
│ usersdefaults_datemodified │ timestamp with time zone │ │ │ │
│ usersdefaults_usercreated │ text │ │ not null │ CURRENT_USER │
│ usersdefaults_usermodified │ text │ │ not null │ CURRENT_USER │
│ usersdefaults_users │ integer │ │ not null │ │
│ usersdefaults_backlinkset │ integer │ │ │ │
│ usersdefaults_wwwset │ integer │ │ │ │
│ usersdefaults_numberoflatestentries │ integer │ │ not null │ 200 │
│ usersdefaults_currencies │ integer │ │ │ │
│ usersdefaults_maingpgkey │ text │ │ │ │
│ usersdefaults_personaldiaryset │ integer │ │ │ │
│ usersdefaults_diaryyear │ text │ │ not null │ 'Year %Y'::text │
│ usersdefaults_diarymonth │ text │ │ not null │ '%B'::text │
│ usersdefaults_diaryday │ text │ │ not null │ '%Y-%m-%d'::text │
│ usersdefaults_screenshots │ integer │ │ │ │
│ usersdefaults_aimemory │ integer │ │ │ │
│ usersdefaults_aimemorysubtype │ integer │ │ │ │
│ usersdefaults_agendadayspan │ integer │ │ not null │ 60 │
│ usersdefaults_prospectingmethodsubtype │ integer │ │ │ │
│ usersdefaults_wrsdir │ text │ │ not null │ '~/tmp/'::text │
│ usersdefaults_markup │ integer │ │ not null │ 1 │
│ usersdefaults_llmmodels │ integer │ │ │ │
│ usersdefaults_quicknotetype │ integer │ │ │ │
│ usersdefaults_quicknotesubtype │ integer │ │ │ │
│ usersdefaults_quicknoteset │ integer │ │ │ │
│ usersdefaults_setvoicemessages │ integer │ │ │ │
└────────────────────────────────────────┴──────────────────────────┴───────────┴──────────┴──────────────────────────────────┘
Indexes:
"usersdefaults_pkey" PRIMARY KEY, btree (usersdefaults_id)
"usersdefaults_usersdefaults_users_key" UNIQUE CONSTRAINT, btree (usersdefaults_users)
Foreign-key constraints:
"usersdefaults_usersdefaults_aimemory_fkey" FOREIGN KEY (usersdefaults_aimemory) REFERENCES hyobjects(hyobjects_id)
"usersdefaults_usersdefaults_aisubtype_fkey" FOREIGN KEY (usersdefaults_aimemorysubtype) REFERENCES hyobjectsubtypes(hyobjectsubtypes_id)
"usersdefaults_usersdefaults_backlinkset_fkey" FOREIGN KEY (usersdefaults_backlinkset) REFERENCES hyobjects(hyobjects_id)
"usersdefaults_usersdefaults_currencies_fkey" FOREIGN KEY (usersdefaults_currencies) REFERENCES currencies(currencies_id)
"usersdefaults_usersdefaults_llmmodels_fkey" FOREIGN KEY (usersdefaults_llmmodels) REFERENCES llmmodels(llmmodels_id)
"usersdefaults_usersdefaults_markup_fkey" FOREIGN KEY (usersdefaults_markup) REFERENCES markuptypes(markuptypes_id)
"usersdefaults_usersdefaults_personaldiaryset_fkey" FOREIGN KEY (usersdefaults_personaldiaryset) REFERENCES hyobjects(hyobjects_id)
"usersdefaults_usersdefaults_prospectingmethodsubtype_fkey" FOREIGN KEY (usersdefaults_prospectingmethodsubtype) REFERENCES hyobjectsubtypes(hyobjectsubtypes_id)
"usersdefaults_usersdefaults_quicknoteset_fkey" FOREIGN KEY (usersdefaults_quicknoteset) REFERENCES hyobjects(hyobjects_id)
"usersdefaults_usersdefaults_quicknotesubtype_fkey" FOREIGN KEY (usersdefaults_quicknotesubtype) REFERENCES hyobjectsubtypes(hyobjectsubtypes_id)
"usersdefaults_usersdefaults_quicknotetype_fkey" FOREIGN KEY (usersdefaults_quicknotetype) REFERENCES hyobjectypes(hyobjectypes_id)
"usersdefaults_usersdefaults_screenshots_fkey" FOREIGN KEY (usersdefaults_screenshots) REFERENCES hyobjects(hyobjects_id)
"usersdefaults_usersdefaults_setvoicemessages_fkey" FOREIGN KEY (usersdefaults_setvoicemessages) REFERENCES hyobjects(hyobjects_id)
"usersdefaults_usersdefaults_users_fkey" FOREIGN KEY (usersdefaults_users) REFERENCES users(users_id)
"usersdefaults_usersdefaults_wwwset_fkey" FOREIGN KEY (usersdefaults_wwwset) REFERENCES hyobjects(hyobjects_id)
Triggers:
insert_username_usersdefaults BEFORE INSERT OR UPDATE ON usersdefaults FOR EACH ROW EXECUTE FUNCTION insert_username('usersdefaults_usermodified')
usersdefaults_moddatetime BEFORE UPDATE ON usersdefaults FOR EACH ROW EXECUTE FUNCTION moddatetime('usersdefaults_datemodified')
Request
Need to constrain usersdefaults_aimemory to hyobjects_id which hyobjects_hyobjectsubtypes must be usersdefaults_aimemorysubtype
Response
To enforce the constraint that usersdefaults_aimemory must reference a hyobjects_id where the corresponding hyobjects_hyobjectsubtypes is equal to usersdefaults_aimemorysubtype, you can use a check constraint. This constraint will ensure that the referenced hyobjects_id in the hyobjects table matches the hyobjects_hyobjectsubtypes in the hyobjectsubtypes table.
Here is how you can add the check constraint:
ALTER TABLE usersdefaults
ADD CONSTRAINT check_aimemory_subtype
CHECK (
(usersdefaults_aimemory IS NULL AND usersdefaults_aimemorysubtype IS NULL) OR
EXISTS (
SELECT 1
FROM hyobjects
JOIN hyobjectsubtypes ON hyobjects.hyobjectsubtypes_id = hyobjectsubtypes.hyobjectsubtypes_id
WHERE hyobjects.hyobjects_id = usersdefaults_aimemory
AND hyobjects.hyobjectsubtypes_id = usersdefaults_aimemorysubtype
)
);
This check constraint ensures that either both usersdefaults_aimemory and usersdefaults_aimemorysubtype are null, or there exists a row in the hyobjects table where the hyobjects_id matches usersdefaults_aimemory and the hyobjectsubtypes_id matches usersdefaults_aimemorysubtype.
Explanation:
- NULL Case: If both
usersdefaults_aimemoryandusersdefaults_aimemorysubtypeare null, the constraint is satisfied. - Existence Check: If neither are null, the constraint checks if there is a row in the
hyobjectstable where:- The
hyobjects_idmatchesusersdefaults_aimemory. - The
hyobjectsubtypes_idmatchesusersdefaults_aimemorysubtype.
- The
By adding this check constraint, you ensure that the usersdefaults_aimemory and usersdefaults_aimemorysubtype columns are always consistent with the relationships defined in the hyobjects and hyobjectsubtypes tables.
Evaluation
It did not work.
Alternative with Deepseek
CREATE OR REPLACE FUNCTION validate_aimemory_subtype()
RETURNS TRIGGER AS $$
BEGIN
-- Check if the referenced hyobjects_id has the correct hyobjectsubtypes
IF NEW.usersdefaults_aimemory IS NOT NULL AND NEW.usersdefaults_aimemorysubtype IS NOT NULL THEN
IF NOT EXISTS (
SELECT 1
FROM hyobjects
WHERE hyobjects_id = NEW.usersdefaults_aimemory
AND hyobjects_hyobjectsubtypes = NEW.usersdefaults_aimemorysubtype
) THEN
RAISE EXCEPTION 'The referenced hyobjects_id does not match the required hyobjectsubtypes.'
USING ERRCODE = '23503';
END IF;
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
and
CREATE TRIGGER enforce_aimemory_subtype_trigger
BEFORE INSERT OR UPDATE ON usersdefaults
FOR EACH ROW
EXECUTE FUNCTION validate_aimemory_subtype();
the solution by Deepseek worked correctly.
I don't think that such request is complex, though 7B OneSQL can't handle it.
Not even Phi-3.5-mini-instruct, and not even Phi-4.
This is about improving a schema?
Also try QwQ-32B. Some chat providers support it
Yes, I have been improving it today, with 7B model and it did all what I needed without any mistake.
QwQ-32B quantized runs on my 24 GB VRAM, and I can't wait for long thinking results, no matter accuracy, I did not even wait enough to verify accuracy. This OneSQL works well so far for my use cases.