Skip to content

[FEATURE] LiteLLM RPC Integration #138

@akash9676

Description

@akash9676

Summary

Add a new RPC service in the CARE backend to route LLM requests through LiteLLM instead of BrokerIO, reducing latency and complexity for general-purpose LLM calls.

Motivation

Currently, all model requests including simple LLM prompts are routed through BrokerIO. BrokerIO was designed for orchestrating specialized NLP models and introduces unnecessary overhead (queuing, skill lookup, resource binding) for straightforward LLM API calls. A dedicated LiteLLM RPC path provides a lighter, faster route.

Requirements

  • Create a new LiteLLMRPC service extending the existing RPC base class
  • Support communication with LiteLLM via WebSocket (consistent with CARE's RPC pattern)
  • Route requests to external LLM APIs (OpenAI, Anthropic, etc.) and locally hosted models (Ollama) through LiteLLM
  • Keep BrokerIO intact for specialized NLP skills
  • The NLP service should determine the correct path (LiteLLM or BrokerIO) based on the request type
  • Log all requests and responses in the database for cost tracking and research

Acceptance Criteria

  • A request from the frontend can reach an external LLM (e.g. GPT-4o) via LiteLLM and return a response
  • A request from the frontend can reach a local model (e.g. Ollama) via LiteLLM and return a response
  • Existing BrokerIO-based NLP skills continue to work without changes
  • All LLM inputs and outputs are recorded in the database

References

  • Existing RPC base class: backend/webserver/RPC.js
  • NLP service: backend/webserver/services/nlp.js
  • LiteLLM docs: https://docs.litellm.ai/

Metadata

Metadata

Assignees

Labels

backendrequires changes in the backend of CAREenhancementNew feature or requestfrontendrequires changes in the frontend of CARE

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions