Marketplace · Text & chat

sqlcoder:7b

Call sqlcoder:7b through one OpenAI-compatible API. It's served by 1 host on the Inpherio grid, each at a price it sets — your request goes to the cheapest healthy one, and fails over to the next if it's down.

From
£0.12
per 1M output tokens
£1 buys about 8.3 million tokens (≈ 6.3 million words)
Hosts
1
Loaded now
0

At a glance.

code sql

  • Type: Text & chat
  • Hosts serving it now: 1 (0 with it loaded in memory)
  • Engines: ollama
  • Context window: up to 32,768 tokens
  • Rentable: a whole host from £0.60 an hour (rentals)
python · openai sdk
from openai import OpenAI
client = OpenAI(base_url="https://inpherio.co.uk/v1",
                api_key=INPHERIO_API_KEY)
reply = client.chat.completions.create(
    model="sqlcoder:7b",
    messages=[{"role": "user", "content": "Hello"}],
)

sqlcoder:7b in detail.

SQLCoder is a code completion model fined-tuned on StarCoder for SQL generation tasks

Published by
defog
Parameters
6.7B
Download size
4.1 GB (as packaged for Ollama)
Quantisation
Q4_0
Format
gguf
Architecture
llama
Licence
CC BY-SA 4.0
Task
text generation
Library
transformers
First published
5 Feb 2024
Last updated
12 Feb 2024
Downloads (30 days)
445,389 on Hugging Face
Likes
452

gguf llama text-generation

The model card

Published by the model's authors on Hugging Face — shown as they wrote it, unedited by Inpherio.

Update notice

The model weights were updated at 7 AM UTC on Feb 7, 2024. The new model weights lead to a much more performant model – particularly for joins.

If you downloaded the model before that, please redownload the weights for best performance.

Model Card for SQLCoder-7B-2

A capable large language model for natural language to SQL generation.

Model Details

Model Description

This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.

  • Developed by: Defog, Inc
  • Model type: [Text to SQL]
  • License: [CC-by-SA-4.0]
  • Finetuned from model: [CodeLlama-7B]

Model Sources [optional]

Uses

This model is intended to be used by non-technical users to understand data inside their SQL databases. It is meant as an analytics tool, and not as a database admin tool.

This model has not been trained to reject malicious requests from users with write access to databases, and should only be used by users with read-only access.

How to Get Started with the Model

Use the code here to get started with the model.

Prompt

Please use the following prompt for optimal results. Please remember to use do_sample=False and num_beams=4 for optimal results.

### Task
Generate a SQL query to answer [QUESTION]{user_question}[/QUESTION]

### Database Schema
The query will run on a database with the following schema:
{table_metadata_string_DDL_statements}

### Answer
Given the database schema, here is the SQL query that [QUESTION]{user_question}[/QUESTION]
[SQL]

Evaluation

This model was evaluated on SQL-Eval, a PostgreSQL based evaluation framework developed by Defog for testing and alignment of model capabilities.

You can read more about the methodology behind SQLEval here.

Results

We classified each generated question into one of 6 categories. The table displays the percentage of questions answered correctly by each model, broken down by category.

dategroup_byorder_byratiojoinwhere
sqlcoder-70b9691.497.185.797.191.4
sqlcoder-7b-29691.494.391.494.377.1
sqlcoder-34b8094.385.777.185.780
gpt-47294.397.18091.480
gpt-4-turbo7691.491.462.888.677.1
natural-sql-7b5688.685.76088.680
sqlcoder-7b6482.974.354.374.374.3
gpt-3.57277.182.834.365.771.4
claude-25271.474.357.165.762.9

Model Card Contact

Contact us on X at @defogdata, or on email at [email protected]

Sources: defog/sqlcoder-7b-2 on Hugging Face · sqlcoder:7b on Ollama. Collected from public sources on 8 Nov 2026; the host serving it may run a different build or quantisation — the marketplace shows each host's own measurements.

Who's serving it.

Every host benchmarked this model on its own hardware before serving it. Prices are set by each host; health is scored by the platform from what it observes.

Hosts serving sqlcoder:7b right now
HostTierPriceMeasured speedHealthStateRent
GTX 1080 Ti (11G)L1£0.058 in · £0.12 out6 tok/s · 175 ms first token78loads on request£0.60/h

Live data, refreshed on every visit. How billing works.

Room on the grid for your machine.

Right now one machine serves sqlcoder:7b. If it drops, so does every request for it — a second host is what turns it into failover, and the grid needs that more than another copy. The router weighs price, measured speed, health and whether the model is already loaded — so a host with a sharper price or quicker hardware wins the next call.

Hosts now
1
0 loaded in memory
Price to beat
£0.12
per 1M output tokens
Fastest measured
6 tok/s

Set your own price — you keep 85% of what it earns, and new hosts start with 12 months fee-free (up to £250 of earnings). A payout fee of £2 + 1% per payout to a UK bank account, £2 + 2% to any other country applies when you're paid. Install the connector, load sqlcoder:7b, and the platform benchmarks it on your hardware before your first request.