Skip to content

Add SSL verification and chat model support for LiteLLM provider#130

Open
NiklasPhabian wants to merge 1 commit into
plmbr:mainfrom
NiklasPhabian:feature/litellm-ssl-and-chat-support
Open

Add SSL verification and chat model support for LiteLLM provider#130
NiklasPhabian wants to merge 1 commit into
plmbr:mainfrom
NiklasPhabian:feature/litellm-ssl-and-chat-support

Conversation

@NiklasPhabian
Copy link
Copy Markdown

@NiklasPhabian NiklasPhabian commented Mar 31, 2026

Summary

This PR adds two improvements to the LiteLLM compatible provider:

  1. Configurable SSL verification for self-signed certificates
  2. Support for chat-only models (like Anthropic) in inline completions

Fixes #128
Fixes #129

Changes

SSL Verification (Issue #128)

  • Added verify_ssl property to both LiteLLMCompatibleChatModel and LiteLLMCompatibleInlineCompletionModel
  • Defaults to true (secure by default)
  • Sets litellm.ssl_verify module setting before API calls
  • Allows users with self-signed certificates to opt-in by setting "verify_ssl": "false" in their config

Chat Model Support for Inline Completions (Issue #129)

  • Implemented fallback mechanism: tries FIM format first, falls back to chat format
  • Maintains backward compatibility with FIM-capable models (OpenAI Codex, etc.)
  • Adds support for chat-only models like Anthropic Claude
  • Strips markdown code blocks from chat model responses

Testing

Tested with:

  • Anthropic Claude via LiteLLM proxy with self-signed certificate
  • Inline chat (Ctrl+G) - working ✅
  • Sidebar chat - working ✅
  • Autocomplete/inline completions - working ✅

Backward Compatibility

  • verify_ssl is optional and defaults to true (secure)
  • FIM format is tried first for existing setups
  • No breaking changes to existing configurations

Usage Example

For users with self-signed certificates, add to your config:

{
  "chat_model": {
    "properties": [
      ...
      {
        "id": "verify_ssl",
        "name": "Verify SSL",
        "description": "Verify SSL certificates (disable for self-signed certificates)",
        "value": "false",
        "optional": true
      }
    ]
  }
}

- Add configurable verify_ssl property (defaults to true for security)
- Set litellm.ssl_verify module setting based on user configuration
- Fix inline completions to support chat-only models like Anthropic
- Implement FIM-to-chat fallback mechanism for compatibility
- Strip markdown code blocks from chat model responses

Fixes plmbr#128
Fixes plmbr#129
)
return litellm_resp.choices[0].message.content
except Exception as e:
# Fall back to chat format for models that don't support FIM
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NiklasPhabian can you use the same logic / prompts as in #117?

return litellm_resp.choices[0].message.content
except Exception as e:
# Fall back to chat format for models that don't support FIM
prompt_text = f"You are an autocomplete engine. Complete the {language} code at the cursor position. "
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better to move this logic to a method.
and keep track of models (based on model_id in a set) that failed, so that you can directly use the chat completions next time.

@pjdoland pjdoland added the enhancement New feature or request label May 5, 2026
@mbektas mbektas added the blocked Blocked due to conflicts or no response from author label May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Blocked due to conflicts or no response from author enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LiteLLM inline completions don't work with chat-only models like Anthropic Add configurable SSL verification for LiteLLM compatible provider

3 participants