Add your Community Resource Pool API key in Settings
Access LLM inference powered by community contributors running Ollama and LM Studio. Free, open-source, and community-driven. Contributors share their local compute resources to create a decentralized inference network.
| Field | Type | Required | Description |
|---|---|---|---|
| gatewayUrl | url | Optional | Resource pool gateway URL |
| apiKey | password | Optional | Optional API key for authenticated access and priority routing |
| preferredModels | text | Optional | Comma-separated list of preferred models |
| timeout | number | Optional | Maximum time to wait for inference response |
Add provider:
npx webinfer provider add resource-pool --key YOUR_API_KEYTest connection:
npx webinfer provider test resource-poolGet your API key from https://webinfer.com/docs/resource-pool
Basic usage:
import { generateText } from "webinfer"
// WebInfer automatically routes to the best available provider
const result = await generateText({
prompt: "Write a haiku about programming"
})
console.log(result.text)Specify Community Resource Pool explicitly:
import { generateText } from "webinfer"
const result = await generateText({
prompt: "Write a haiku about programming",
provider: "resource-pool",
model: "auto"
})
console.log(result.text)
console.log("Provider:", result.provider)
console.log("Model:", result.model)Streaming:
import { streamText } from "webinfer"
const { textStream } = await streamText({
prompt: "Write a story about AI",
provider: "resource-pool"
})
for await (const chunk of textStream) {
process.stdout.write(chunk)
}