Providers¶
Configure different LLM providers through LangChain or official SDKs for local tools.
Supported Providers¶
| Provider | Identifier | Current models | Default model |
|---|---|---|---|
| OpenAI | openai |
gpt-6-luna, gpt-6-sol, gpt-6-astra | gpt-6-luna |
google_genai |
gemini-3.8-flash, gemini-3.6-flash, gemini-3.5-flash-lite | gemini-3.8-flash |
|
| Anthropic | anthropic |
claude-sonnet-5, claude-opus-5-5, claude-haiku-4-5 | claude-sonnet-5 |
| Groq | groq |
openai/gpt-oss-120b, openai/gpt-oss-20b | openai/gpt-oss-120b |
| OpenAI Codex (experimental) | codex |
Models supported by the bundled runtime | Chosen by the runtime |
| Claude Code | claude_code |
Models and aliases accepted by Claude Code (sonnet, haiku, opus) |
Chosen by the runtime |
| Cohere | cohere |
Cohere catalog | Pass model |
| Mistral | mistralai |
Mistral catalog | Pass model |
Without provider, dataframeit uses openai with gpt-6-luna. With provider and no model, it uses that provider's default model from the table; providers without a default model require model. Any other provider accepted by LangChain's init_chat_model also works, as long as the langchain-<provider> package is installed.
Which provider to choose¶
| Situation | Provider | Why |
|---|---|---|
| Getting started, or high volume at low cost | openai (default) |
gpt-6-luna has the lowest price per token among the models with prices listed below |
| Free tier for testing | groq |
Free per-minute limits on each model |
| A harder task that the default model handles poorly | larger model from the same provider (gpt-6-sol, claude-opus-5-5) |
Costs more per token; compare on a sample first |
| Codex or Claude Code login, no API key | codex or claude_code |
They use the tool's local authentication; they do not support web search |
| Data that must stay in Brazil | Vertex AI, Bedrock or Azure | See Brazilian region |
| Web search | any provider via LangChain | codex and claude_code do not support use_search=True |
Before processing the whole dataset, run a sample of 20 to 50 rows and check the result and the cost in the statistics summary.
OpenAI (Default)¶
# Default - no need to specify
result = dataframeit(df, Model, PROMPT)
# With a more advanced model
result = dataframeit(
df, Model, PROMPT,
provider='openai',
model='gpt-6-sol',
model_kwargs={
'reasoning_effort': 'medium'
}
)
Recommended Models¶
| Model | Use | Price (1M tokens, input / output) |
|---|---|---|
gpt-6-luna |
High volume, focused tasks | $0.10 / $0.50 |
gpt-6-sol |
Complex and agentic tasks | $2.00 / $10.00 |
gpt-6-astra |
Maximum quality | $10.00 / $50.00 |
Google Gemini¶
result = dataframeit(
df, Model, PROMPT,
provider='google_genai' # uses gemini-3.8-flash
)
# With extra parameters
result = dataframeit(
df, Model, PROMPT,
provider='google_genai',
model='gemini-3.5-flash-lite',
model_kwargs={
'thinking_level': 'low'
}
)
Recommended Models¶
| Model | Use | Price (1M tokens, input / output) |
|---|---|---|
gemini-3.8-flash |
General use, newest | $0.75 / $3.75 through 12/31/2026; $1.50 / $7.50 from 2027 |
gemini-3.6-flash |
General use | $0.75 / $3.75 through 12/31/2026; $1.50 / $7.50 from 2027 |
gemini-3.5-flash-lite |
High volume, economical | $0.30 / $2.50 |
OpenAI Codex (Experimental)¶
The codex provider uses the official Python SDK and remains experimental. For extra installation, runtime selection, and local file-backed authentication, see Installation.
result = dataframeit(
df,
Model,
PROMPT,
provider='codex', # no model: the runtime chooses
model_kwargs={'effort': 'medium'},
parallel_requests=3,
)
For this provider, model_kwargs accepts only effort and timeout. effort takes one of the values the SDK declares: none, minimal, low, medium, high, xhigh, max, and ultra; each model accepts only some of them. timeout is the deadline, in seconds, for each attempt, from opening the thread to the end of the turn, with a default of 600: a turn that does not finish in time is interrupted, the attempt fails with ProviderTransientError, and the row is retried according to max_retries. If the deadline runs out before the app-server answers the request that opens the thread or the turn, the app-server is shut down and the run stops with ProviderAbortError; rows without a status are left for resume=True. With timeout=None, there is no deadline. Changing timeout does not prevent resuming a checkpoint. use_search=True is not supported. The Pydantic model must have fields at the root and use the JSON Schema subset accepted by Structured Outputs; RootModel, Any, dynamic-key dict fields, validation keywords outside the subset, such as those of fixed tuples, sets, and min_length/max_length on strings, format values outside the supported list, such as those of bytes, Path, AnyUrl, and UUID4, and pattern values with lookahead, lookbehind, or backreferences, such as the one pydantic before 2.14 generates for Decimal, are rejected during preflight. Keys that do not constrain the value, such as custom annotations in json_schema_extra and the examples and deprecated metadata, are dropped from the schema sent, with a warning listing them; the response is still validated by the Pydantic model. Authentication configured during installation comes from auth.json, so do not pass api_key to dataframeit().
With model, the library checks at startup, through a thread with no turn, that the runtime resolved the requested model, and fails before the first row if it did not; without model, a warning says which model will be used. A turn that the runtime reroutes to another model is interrupted, and the row fails. effort is sent with each turn and does not come back in the runtime's response, so it is not checked.
The error of a failed turn is classified by the code the runtime sends: overload, rate limiting, missing flex-tier capacity, HTTP 429, and 5xx are retried; an exhausted usage quota and a terminated runtime interrupt the run, as described in Checkpoints. When a later attempt succeeds, tokens from the failed ones count toward the row's usage.
DataFrameIt keeps one codex app-server per DataFrame run and opens one ephemeral thread per attempt of each row. When the attempt ends, the thread receives thread/unsubscribe, and the app-server unloads it after about one minute without a subscriber; its memory follows the threads of the last minute, not the total number of rows. Every run uses isolated CODEX_HOME and workspace directories, and HOME points to the same directory, so that user skills, such as those in ~/.agents/skills, stay out of the run (on Windows, where the user folder does not come from HOME, this isolation has not been verified); auth.json is the only file from Codex's persistent state linked into the runtime, which still inherits the other process environment variables. While one run uses the credential, another DataFrameIt run with the same auth.json fails before starting the runtime; this prevents concurrent refresh without affecting parallel_requests within the active run. This lock coordinates DataFrameIt instances only, so do not run the Codex CLI with the same credential until processing finishes. Web search, shell access, MCP servers, subagents, image viewing, questions to the user, and the sleep tool are disabled, as is the runtime's unbounded retry of failed connections, which would leave the turn waiting forever; a row that cannot connect fails with a transient error and is retried according to max_retries. Approvals are denied, and the read-only sandbox blocks writes. At the start of a run, DataFrameIt reads the account's model catalog, or the runtime's bundled one when the download fails, and passes it to the runtime without the fields that enable code mode (exec and wait), the experimental tools, and apply_patch; the model therefore receives the request with no tools at all. The catalog is read once per run and does not change during it.
Claude Code¶
The claude_code provider uses the Claude Agent SDK, which runs the Claude Code CLI. Authentication is Claude Code's own: the credentials of a login done with a Claude Code installation on the machine (the CLI shipped with the extra is not on PATH), or ANTHROPIC_API_KEY. The api_key parameter is ignored.
result = dataframeit(
df,
Model,
PROMPT,
provider='claude_code',
model='haiku',
model_kwargs={'max_budget_usd': 0.25, 'effort': 'low'},
)
In model_kwargs, the provider reads max_turns (default 1), max_budget_usd (default 0.50) and effort; other keys are ignored. max_budget_usd caps the spending of each attempt: since an empty or off-schema answer is retried, a row can spend up to max_retries times that value. use_search=True is not supported.
Row text is treated as untrusted content. The run has no tools, no user or project settings and uses --strict-mcp-config, so MCP servers and permissions.allow rules configured in Claude Code do not reach it. A row that exceeds max_budget_usd or max_turns ends in a final error, with no retry.
With track_tokens=True, the summary at the end of the run shows the cost reported by the SDK, including retried attempts and rows that failed.
Anthropic Claude¶
result = dataframeit(
df, Model, PROMPT,
provider='anthropic' # uses claude-sonnet-5
)
# With max_tokens
result = dataframeit(
df, Model, PROMPT,
provider='anthropic',
model='claude-opus-5-5',
model_kwargs={
'max_tokens': 4096
}
)
Recommended Models¶
| Model | Use | Price (1M tokens, input / output) |
|---|---|---|
claude-sonnet-5 |
General use, speed and quality | $2.00 / $10.00 |
claude-opus-5-5 |
Maximum quality, agentic | $4.00 / $20.00 |
claude-haiku-4-5 |
Fast, economical | $1.00 / $5.00 |
Groq¶
result = dataframeit(
df, Model, PROMPT,
provider='groq' # uses openai/gpt-oss-120b
)
# Faster/cheaper model
result = dataframeit(
df, Model, PROMPT,
provider='groq',
model='openai/gpt-oss-20b'
)
Recommended Models¶
Production:
| Model | Context | Throughput | Use |
|---|---|---|---|
openai/gpt-oss-120b |
131K | ~500 t/s | General use, reasoning |
openai/gpt-oss-20b |
131K | ~1000 t/s | Faster than 120b, low cost |
Preview (may change or be discontinued):
| Model | Use |
|---|---|
qwen/qwen3.8-27b |
Qwen 3.8, thinking and instruct modes |
Availability and free tier
Groq offers a free tier with per-minute request limits per model. The model catalog changes frequently (especially preview models); check console.groq.com/docs/models for the current list and limits.
Cohere¶
Mistral¶
Brazilian region (São Paulo)¶
The providers above use global public endpoints. To serve from Brazil, for latency, data residency or regulatory reasons, use one of the three options below. In all of them, dataframeit forwards model_kwargs straight to LangChain.
Vertex AI (Gemini in southamerica-east1)¶
Two variants. The first one needs no extra package install:
# Variant A: uses langchain-google-genai (already a dep of provider 'google_genai')
result = dataframeit(
df, Model, PROMPT,
provider='google_genai',
model='gemini-3.8-flash',
model_kwargs={
'vertexai': True,
'project': '<gcp-project-id>',
'location': 'southamerica-east1',
},
)
# Variant B: uses langchain-google-vertexai (dedicated provider)
# pip install langchain-google-vertexai
result = dataframeit(
df, Model, PROMPT,
provider='google_vertexai',
model='gemini-3.8-flash',
model_kwargs={
'project': '<gcp-project-id>',
'location': 'southamerica-east1',
},
)
Authentication (any variant):
gcloud auth application-default login
# OR
export GOOGLE_APPLICATION_CREDENTIALS=/path/service-account.json
AWS Bedrock (sa-east-1)¶
result = dataframeit(
df, Model, PROMPT,
provider='bedrock_converse',
model='global.anthropic.claude-sonnet-5',
model_kwargs={'region_name': 'sa-east-1'},
)
On Bedrock, the Converse API only accepts Claude Sonnet 5 through an inference profile, and in sa-east-1 the only profile offered is the global one (global.), which may process the request outside Brazil. If data residency is a requirement, check in the Bedrock console which models the region offers with a regional profile.
For the legacy Bedrock API (non-converse), switch to provider='bedrock' keeping the same model_kwargs. The newer API (bedrock_converse) is recommended for new projects.
Azure OpenAI (Brazil South)¶
pip install langchain-openai
export AZURE_OPENAI_API_KEY="your-key"
export AZURE_OPENAI_ENDPOINT="https://<your-resource>.openai.azure.com/"
export OPENAI_API_VERSION="2025-03-01-preview"
result = dataframeit(
df, Model, PROMPT,
provider='azure_openai',
model='gpt-6-luna', # or the deployment name
model_kwargs={'azure_deployment': '<deployment-name>'},
)
The region is encoded in AZURE_OPENAI_ENDPOINT: provision the resource in "Brazil South" via the Azure portal.
The API version (OPENAI_API_VERSION) changes often. Check the latest stable version at aka.ms/azure-openai-api-versions.
Prices change
Prices in the tables above are standard-tier list prices per 1M tokens, with already announced changes shown in the table itself. Check current prices on the providers' official websites.
Passing API Key Directly¶
If you prefer not to use environment variables:
Security
Avoid putting API keys directly in code. Prefer environment variables.
Common Parameters (model_kwargs)¶
| Parameter | Description | Providers |
|---|---|---|
temperature |
Creativity. dataframeit sends no default value | Model-dependent: several current models reject it (e.g. Claude Sonnet 5, OpenAI GPT-6 with reasoning and o-series) |
top_p |
Nucleus sampling | Model-dependent, like temperature |
max_tokens |
Output limit | Providers via LangChain |
The codex and claude_code providers do not use these parameters: codex accepts only effort and timeout and rejects the other keys before starting; claude_code reads only max_turns, max_budget_usd and effort and ignores the rest.