Instructions to use llmware/slim-sql-tool with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use llmware/slim-sql-tool with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("llmware/slim-sql-tool", dtype="auto") - llama-cpp-python
How to use llmware/slim-sql-tool with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="llmware/slim-sql-tool", filename="slim-sql.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use llmware/slim-sql-tool with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf llmware/slim-sql-tool # Run inference directly in the terminal: llama-cli -hf llmware/slim-sql-tool
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf llmware/slim-sql-tool # Run inference directly in the terminal: llama-cli -hf llmware/slim-sql-tool
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 llmware/slim-sql-tool # Run inference directly in the terminal: ./llama-cli -hf llmware/slim-sql-tool
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 llmware/slim-sql-tool # Run inference directly in the terminal: ./build/bin/llama-cli -hf llmware/slim-sql-tool
Use Docker
docker model run hf.co/llmware/slim-sql-tool
- LM Studio
- Jan
- Ollama
How to use llmware/slim-sql-tool with Ollama:
ollama run hf.co/llmware/slim-sql-tool
- Unsloth Studio
How to use llmware/slim-sql-tool 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 llmware/slim-sql-tool 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 llmware/slim-sql-tool to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for llmware/slim-sql-tool to start chatting
- Docker Model Runner
How to use llmware/slim-sql-tool with Docker Model Runner:
docker model run hf.co/llmware/slim-sql-tool
- Lemonade
How to use llmware/slim-sql-tool with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull llmware/slim-sql-tool
Run and chat with the model
lemonade run user.slim-sql-tool-{{QUANT_TAG}}List all available models
lemonade list
Update README.md
Browse filesfix code formatting
README.md
CHANGED
|
@@ -15,28 +15,28 @@ license: apache-2.0
|
|
| 15 |
|
| 16 |
|
| 17 |
To pull the model via API:
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
Load in your favorite GGUF inference engine, or try with llmware as follows:
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
ModelCatalog().tool_test_run("slim-sql-tool", verbose=True)
|
| 30 |
-
|
| 31 |
|
| 32 |
Slim models can also be orchestrated as part of multi-model, multi-step LLMfx calls:
|
|
|
|
|
|
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
response = llm_fx.sql(query, table_schema)
|
| 39 |
-
|
| 40 |
|
| 41 |
Note: please review [**config.json**](https://huggingface.co/llmware/slim-sql-tool/blob/main/config.json) in the repository for prompt wrapping information, details on the model, and full test set.
|
| 42 |
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
To pull the model via API:
|
| 18 |
+
```python
|
| 19 |
+
from huggingface_hub import snapshot_download
|
| 20 |
+
snapshot_download("llmware/slim-sql-tool", local_dir="/path/on/your/machine/", local_dir_use_symlinks=False)
|
| 21 |
+
```
|
| 22 |
|
| 23 |
Load in your favorite GGUF inference engine, or try with llmware as follows:
|
| 24 |
+
```python
|
| 25 |
+
from llmware.models import ModelCatalog
|
| 26 |
|
| 27 |
+
# this one line will download the model and run a series of tests
|
| 28 |
+
# includes two sample table schema - go to llmware github repo for end-to-end example
|
| 29 |
+
ModelCatalog().tool_test_run("slim-sql-tool", verbose=True)
|
| 30 |
+
```
|
|
|
|
|
|
|
| 31 |
|
| 32 |
Slim models can also be orchestrated as part of multi-model, multi-step LLMfx calls:
|
| 33 |
+
```python
|
| 34 |
+
from llmware.agents import LLMfx
|
| 35 |
|
| 36 |
+
llm_fx = LLMfx()
|
| 37 |
+
llm_fx.load_tool("sql")
|
| 38 |
+
response = llm_fx.sql(query, table_schema)
|
| 39 |
+
```
|
|
|
|
|
|
|
| 40 |
|
| 41 |
Note: please review [**config.json**](https://huggingface.co/llmware/slim-sql-tool/blob/main/config.json) in the repository for prompt wrapping information, details on the model, and full test set.
|
| 42 |
|