Add an openai-compatible provider type and registerProvider() for custom providers
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- backend-api-design
Línea de trabajo
Start with packages/core/src/providers/base.ts and openai.ts, then review types.ts and the provider config and OpenAI tests named in the issue. Add the compatible provider options and custom provider registry while preserving the built-in provider behavior. Done means the listed acceptance tests pass, pnpm test:coverage and pnpm lint pass, and the @chatcops/core minor changeset is included.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Pointing ChatCops at Ollama, LM Studio, vLLM, Groq or OpenRouter works today through type: 'openai' with a baseURL, but it's awkward. You need an API key even when the server doesn't use one, it sends max_completion_tokens, which many of those servers don't know, and there's no way to turn tools off for a model that can't call them. A provider that isn't OpenAI-shaped can't be plugged in at all: createProvider only knows three types (packages/core/src/providers/base.ts, lines 10 to 27).
What to do
- A built-in
openai-compatibletype:provider: { type: 'openai-compatible', baseURL: 'http://localhost:11434/v1', // required model: 'llama3.2', // required, no default apiKey: process.env.GROQ_API_KEY, // optional headers: { 'HTTP-Referer': 'https://acme.com' }, // optional, sent on every request supportsTools: false, // optional, default true }- It runs on the OpenAI SDK, like the
openaitype. GiveOpenAIProvider's constructor (packages/core/src/providers/openai.ts, line 42) a small options argument rather than copying the class.nameis'openai-compatible', andheadersbecomes the SDK'sdefaultHeaders. maxTokensParamdefaults to'max_tokens'for this type.- Without
apiKey, pass a placeholder to the SDK, since it refuses to start with none. - With
supportsTools: false, don't sendtools, and log one warning if the server config has tools. - Throw a clear error at setup when
baseURLormodelis missing.
- It runs on the OpenAI SDK, like the
registerProvider(type, factory)in a newpackages/core/src/providers/registry.ts, exported from@chatcops/core:registerProvider('my-llm', async (config) => new MyProvider(config));createProviderlooks up registered types before the built-in switch.- Registering a built-in name (
claude,openai,gemini,openai-compatible) throws. - Registering the same custom name twice replaces it, so hot reload works.
ProviderConfig.type(packages/core/src/types.ts) widens to the four built-ins plus(string & {}), so editors still suggest the built-ins.apiKeybecomes optional in the type. The three hosted providers throw a clear error at setup when it's missing, which the server already reports nicely since #216.
Where to look
packages/core/src/providers/base.ts(createProvider)packages/core/src/providers/openai.ts(constructor andrequest())packages/core/tests/providers/provider-config.test.ts,openai.test.tswebsite/src/content/docs/core/providers.mdx(a separate issue updates the docs page once this lands)
Acceptance criteria
-
openai-compatibleworks without an API key, sendsmax_tokens, sends the extra headers, and leaves outtoolswhensupportsToolsis false (tests with a fake client or a fakefetch) - A missing
baseURLormodelgives a clear setup error -
registerProviderworks for a custom type, refuses built-in names, and replaces on a second register - An unknown, unregistered type still gives
Unknown provider type: ... - If you have Ollama or LM Studio running locally, say in the PR whether a real request worked (optional, but it helps)
- Changeset for
@chatcops/core(minor) -
pnpm test:coverageandpnpm lintpass
Please get this merged by Nov 3. I rewrite openai.ts after that.
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- Lenguaje dominante
- TypeScript
- Estrellas
- 13
- Forks
- 7
- Merge medio
- 3 h 33 min
- PR fusionados (30 d)
- 176
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codercops/chatcops
-
Add startup checks that catch weak or leaked security settingsPosiblemente ocupada @varun-pahuja la tomó hace 2 días. Abiertoenhancement good first issue hacktoberfest server
codercops/chatcops#231 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Type-check the TypeScript samples in the docsPosiblemente ocupada @An16og la tomó hace 2 días. Abiertodocumentation hacktoberfest help wanted testing
Dificultad 4/5 3-5 días Aptitud para principiantes 70/100
codercops/chatcops#201 · 7 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Hacktoberfest 2026: start hereAbiertohacktoberfest
Dificultad 1/5 Menos de una hora Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Add built-in translations to the widgetPosiblemente ocupada @piyusshhjangid la tomó hace 1 día. Abiertohelp wanted widget
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
codercops/chatcops#55 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de codercops/chatcops
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
db-ux-design-system/core-web#8613 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug:new
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
callstackincubator/simlock#934 ·
Los mantenedores suelen responder en 1 día
-
Log page not working after errorAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
gchq/LD-Explorer#286 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
foxglove/mcap#1907 · 1 comentario ·
Los mantenedores suelen responder en 1 día