Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

defog
/
llama-3-sqlcoder-8b

Text Generation
Transformers
Safetensors
llama
code
conversational
text-generation-inference
Model card Files Files and versions
xet
Community
23

Instructions to use defog/llama-3-sqlcoder-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use defog/llama-3-sqlcoder-8b with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="defog/llama-3-sqlcoder-8b")
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    pipe(messages)
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("defog/llama-3-sqlcoder-8b")
    model = AutoModelForCausalLM.from_pretrained("defog/llama-3-sqlcoder-8b")
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    inputs = tokenizer.apply_chat_template(
    	messages,
    	add_generation_prompt=True,
    	tokenize=True,
    	return_dict=True,
    	return_tensors="pt",
    ).to(model.device)
    
    outputs = model.generate(**inputs, max_new_tokens=40)
    print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
  • Inference
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use defog/llama-3-sqlcoder-8b with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "defog/llama-3-sqlcoder-8b"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "defog/llama-3-sqlcoder-8b",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    Use Docker
    docker model run hf.co/defog/llama-3-sqlcoder-8b
  • SGLang

    How to use defog/llama-3-sqlcoder-8b 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 "defog/llama-3-sqlcoder-8b" \
        --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": "defog/llama-3-sqlcoder-8b",
    		"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 "defog/llama-3-sqlcoder-8b" \
            --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": "defog/llama-3-sqlcoder-8b",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
  • Docker Model Runner

    How to use defog/llama-3-sqlcoder-8b with Docker Model Runner:

    docker model run hf.co/defog/llama-3-sqlcoder-8b
New discussion
Resources
  • PR & discussions documentation
  • Code of Conduct
  • Hub documentation

Dataset format for Finetuning

#20 opened over 1 year ago by
impact-rajath

Hugging Face inference endpoints

1
#18 opened almost 2 years ago by
AlexNevo

Example prompt?

2
#17 opened almost 2 years ago by
fahadh4ilyas

What is the multi-table query capability of this model?

2
#14 opened almost 2 years ago by
LiangcanQiu

Hello! Is this the model powering the demo version?

👍 1
#13 opened almost 2 years ago by
3BB

[AUTOMATED] Model Memory Requirements

#12 opened almost 2 years ago by
model-sizer-bot

is there the GGUF version of the model?

3
#11 opened almost 2 years ago by
MatrixIA

model is bad at generating follow up question response

1
#10 opened almost 2 years ago by
abhisskk

Support presto/trino?

#9 opened almost 2 years ago by
ludong

how mush input tokens does it support

2
#8 opened almost 2 years ago by
nuaabuaa07

Are there any plans to integrate it into vanna.ai?

1
#7 opened almost 2 years ago by
cds1993

License confirm

👍 1
3
#6 opened almost 2 years ago by
caps9129

Are there plans to distribute this model on Ollama.ai?

16
#4 opened almost 2 years ago by
cboettig

May I ask if this model is a chat model or a base model?

1
#3 opened almost 2 years ago by
obtion
Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs