/nlweb-protocol:nlweb-llm-providersfrom nlweb-protocol
Configures NLWeb LLM and embedding providers including OpenAI, Azure OpenAI, Anthropic, Google Gemini, DeepSeek on Azure, Llama on Azure, HuggingFace, Inception Labs, Snowflake Cortex, Ollama, and Pi Labs. Covers config_llm.yaml high/low tier model selection, ModelRouter cost/quality routing, config_embedding.yaml, and adding custom providers.
Ships in nlweb-protocol. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
AskAgent/python/llm_providers/<provider>.py for the SDK calls the provider class makes.NLWeb's pipeline doesn't make one big LLM call per query. It makes many small calls: decontextualize the query, detect Schema.org item type, route to a tool, rank results, optionally summarize/generate. Each call has a strict <returnStruc> JSON schema in prompts.xml. Cost and latency are dominated by the number of calls, not the size of any single one.
config_llm.yaml defines a high model and a low model per provider:
providers:
openai:
high: gpt-4.1
low: gpt-4.1-mini
api_key_env: OPENAI_API_KEY
The codebase decides which tier to use per call site — e.g., decontextualization is "low", final generate is "high". The exact assignment lives in core/ modules and the ModelRouter subsystem.
Out of the box, NLWeb's preferred_endpoint (in config_llm.yaml) is azure_openai with gpt-4.1 / gpt-4.1-mini. Most users override this in .env or by editing the YAML.
(Verify the live config_llm.yaml for current models and key names.)
| Provider | Default high | Default low | Env var |
|---|---|---|---|
| OpenAI | gpt-4.1 | gpt-4.1-mini | OPENAI_API_KEY |
| Azure OpenAI | gpt-4.1 | gpt-4.1-mini | AZURE_OPENAI_API_KEY + AZURE_OPENAI_ENDPOINT |
| Anthropic | claude-3-7-sonnet-latest | claude-3-5-haiku-latest | ANTHROPIC_API_KEY |
| Google Gemini | gemini-2.5-pro | gemini-2.0-flash-lite | GEMINI_API_KEY |
| DeepSeek on Azure | deepseek-coder-33b | deepseek-coder-7b | AZURE_DEEPSEEK_ENDPOINT |
| Llama on Azure | llama-2-70b | llama-2-13b | AZURE_LLAMA_ENDPOINT |
| HuggingFace | Qwen2.5-72B | Qwen2.5-Coder-7B | HF_TOKEN |
| Inception Labs | mercury-small | mercury-small | INCEPTION_API_KEY |
| Snowflake Cortex | claude-3-5-sonnet | llama3.1-8b | Snowflake creds |
| Ollama | configurable | configurable | local — no key |
| Pi Labs | (class present, may not be in default YAML) | — | — |
| Provider | Default model | Dim |
|---|---|---|
| OpenAI | text-embedding-3-small | 1536 |
| Azure OpenAI | text-embedding-3-small | 1536 |
| Gemini | text-embedding-004 | 768 |
| Snowflake | arctic-embed-m-v1.5 | 768 |
| Elasticsearch | multilingual-e5-small | 384 |
| Ollama | nomic-embed-text (typically) | 768 |
Set preferred_provider in config_embedding.yaml. This must match what you used at ingest time — the most common NLWeb bug is changing the embedding provider after data is loaded, then getting empty results.
NLWeb's ModelRouter/ subsystem is a cost/quality router that picks the right model tier (high vs low) per call site. It's still evolving — verify whether it's active in your release.
R.V. Guha's design goal: NLWeb should run on whatever LLM stack the site operator already has. A Snowflake customer uses Cortex; an Azure shop uses Azure OpenAI; a privacy-conscious deployment uses Ollama on prem. The provider abstraction is intentional.
In config_llm.yaml:
preferred_endpoint: anthropic
providers:
anthropic:
high: claude-3-7-sonnet-latest
low: claude-3-5-haiku-latest
api_key_env: ANTHROPIC_API_KEY
Set ANTHROPIC_API_KEY in .env. Restart the server.
Install Ollama, pull a model:
ollama pull llama3.1:8b
ollama pull nomic-embed-text
In config_llm.yaml:
preferred_endpoint: ollama
providers:
ollama:
high: llama3.1:8b
low: llama3.1:8b
base_url: http://localhost:11434
In config_embedding.yaml:
preferred_provider: ollama
providers:
ollama:
model: nomic-embed-text
dim: 768
Important: re-ingest after switching embedding provider — old vectors are now wrong-dim.
llm_providers/ (look at openai.py or anthropic.py as templates).complete() returning JSON-conformant output for the <returnStruc> schemas, plus optional streaming).core/llm.py).config_llm.yaml.<returnStruc> prompt before deploying.low tier for everything except the final generate (default behavior — verify).tool_selection_enabled: false in config_nlweb.yaml to skip the router call entirely.who_endpoint_enabled to skip federated discovery.decontextualized_query client-side to skip that LLM call.# 1. Stop serving traffic
# 2. Change config_embedding.yaml
# 3. Drop the index
python -m data_loading.db_load --only-delete delete-site <site>
# 4. Re-ingest
python -m data_loading.db_load <source> <site>
# 5. Restart
You cannot mix-and-match embedding providers across a single retrieval index. Vectors are not portable across providers.
nlweb check runs connectivity diagnostics for all configured providers. Use it before debugging "the model isn't responding" issues — the answer is usually a missing env var.
deployment_name in config doesn't match what's deployed in Azure. They're per-deployment, not per-model.ollama pull <model> first.Always re-fetch config_llm.yaml from the live repo — provider keys and model IDs change.
What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/nlweb-ask-endpointImplement and consume the NLWeb /ask REST endpoint — request shape (GET/POST, query-string and v0.55 structured body), SSE streaming response, modes (list/summarize/generate), in-stream "message_type" headers, error envelopes, and client-side parsing. Use when building an NLWeb server route, calling /ask from a custom agent, or debugging /ask responses./nlweb-auth-multitenancyConfigure NLWeb authentication and multi-tenant deployments — OAuth providers (GitHub, Google, Microsoft, Facebook), session storage, the `sites:` allowlist in `config_nlweb.yaml`, conversation persistence per authenticated user, and per-tenant data isolation. Use when adding login to an NLWeb instance, hosting multiple customers on one deployment, or persisting conversation history./nlweb-chatgpt-appsdkIntegrate NLWeb with ChatGPT's Apps SDK — the Node.js MCP server in `openai-apps-sdk-integration/`, the `nlweb-list` tool, the React widget at `ui://widget/nlweb-list.html`, and the port-8100 AppSDK adapter that translates NLWeb's message list to OpenAI Apps SDK envelopes. Use when publishing an NLWeb site as a ChatGPT app or wiring NLWeb results into an Apps SDK widget./nlweb-data-loadingIngest site content into NLWeb's vector store using `db_load.py` — supports RSS/Atom feeds, Schema.org JSON-LD, sitemap-driven URL lists, and CSV. Covers chunking, embedding computation, site partitioning, batch sizing, delete-and-reload, and per-backend write_endpoint targeting. Use when bootstrapping a site's index, refreshing content, or migrating between retrieval backends./nlweb-deploymentDeploy NLWeb to production — Azure App Service (`deploy_azure_webapp.sh` + AI Search + Azure OpenAI), Snowflake Container Services, Cloudflare Worker + AutoRAG, Docker, and self-hosted. Covers env-var conventions, `mode: production` lockdown, scaling, TLS, OAuth, and CI for data reloads. Use when going from local dev to a hosted, internet-facing NLWeb instance./nlweb-dev-patternsNLWeb development patterns — the mixed-mode programming philosophy, FastTrack vs Analysis parallel paths, config file precedence and the `mode: development` override trap, in-stream NLWS headers vs HTTP headers, embedding/ingest determinism, debugging the LLM-call chain, neural scorer selection (NLWebScorer ModernBERT+GAM), and the A2A / AgentFinder / DataFinder / ModelRouter subsystems. Use when designing the internal architecture of an NLWeb deployment or solving cross-cutting concerns.npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin nlweb-protocolOther plugins' skills for the same job