Skip to content
Back to skills

Bridgic Llms

ASecurity

LLM provider initialization for bridgic projects. Use when: (1) initializing OpenAILlm, OpenAILikeLlm, or VllmServerLlm, (2) configuring OpenAIConfiguration (model, temperature, max_tokens, timeout), (3) choosing the right provider package for a task, (4) using chat/stream interfaces or advanced protocols (StructuredOutput, ToolSelection).

  • 154 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
ai-agentspythonbashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add bitsky-tech/bridgic --skill bridgic-llms --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bridgic Llms?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bridgic Llms
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bitsky-tech-bridgic-llms/badge)](https://www.skillsdirectory.com/skills/bitsky-tech-bridgic-llms)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: bridgic-llms
description: |
  LLM provider initialization for bridgic projects. Use when: (1) initializing
  OpenAILlm, OpenAILikeLlm, or VllmServerLlm, (2) configuring OpenAIConfiguration
  (model, temperature, max_tokens, timeout), (3) choosing the right provider package
  for a task, (4) using chat/stream interfaces or advanced protocols (StructuredOutput,
  ToolSelection).
---

# Bridgic LLMs

Model-neutral LLM integration with protocol-driven capability declaration.

## Dependencies

| Package | `BaseLlm` | `StructuredOutput` | `ToolSelection` |
|---------|:---------:|:------------------:|:---------------:|
| `bridgic-llms-openai` | yes | yes | yes |
| `bridgic-llms-openai-like` | yes | no | no |
| `bridgic-llms-vllm` | yes | yes | yes |
| `python-dotenv` | — | — | — |

Install only the LLM provider package you need. `python-dotenv` is required for loading `.env` configuration.

**Installation**: Run the install script to set up all dependencies:

```bash
bash "skills/bridgic-llms/scripts/install-deps.sh" "$PWD" [PROVIDER]
```

Supported providers: `openai` (default), `openai-like`, `vllm`. The script checks uv availability, initializes a uv project if needed, installs any missing packages via `uv add`, and runs `uv sync` to finalize the environment. When it exits successfully the project is fully initialized and ready to use — no manual `uv add` / `uv sync` follow-up is required.

## Quick Start

```python
import os
from dotenv import load_dotenv
from bridgic.llms.openai import OpenAILlm, OpenAIConfiguration

load_dotenv()

llm = OpenAILlm(
    api_key=os.environ.get("LLM_API_KEY"),
    api_base=os.environ.get("LLM_API_BASE"),
    configuration=OpenAIConfiguration(
        model=os.environ.get("LLM_MODEL", "gpt-4o"),
        temperature=0.0,
        max_tokens=16384,
    ),
    timeout=180.0,
)
```

## Provider Selection Guide

| Provider | When to Use |
|----------|-------------|
| `OpenAILlm` | Production use, need structured output or tool calling. Works with OpenAI API. |
| `OpenAILikeLlm` | Third-party OpenAI-compatible APIs (DashScope, etc.), only need basic chat/stream. |
| `VllmServerLlm` | Self-hosted vLLM inference server, full capability. |

**Common pitfall**: Do NOT use `OpenAILikeLlm` when you need structured output or tool selection — it does not implement those protocols. Use `OpenAILlm` instead.

## Basic Interfaces

All providers implement `BaseLlm`:

```python
from bridgic.core.model.types import Message, Role

messages = [
    Message.from_text("You are a helpful assistant.", role=Role.SYSTEM),
    Message.from_text("Hello!", role=Role.USER),
]

# Chat — complete response
response = llm.chat(messages=messages, model="gpt-4o", temperature=0.7)
print(response.message.content)

# Stream — real-time chunks
for chunk in llm.stream(messages=messages, model="gpt-4o"):
    print(chunk.delta, end="", flush=True)
```

## Advanced Protocols

See [references/llm-integration.md](references/llm-integration.md) for:
- `StructuredOutput` — generate Pydantic model instances or JSON schema conformant output
- `ToolSelection` — function/tool calling with Tool definitions
- Full code examples for all providers

## Reference Files

| Scenario | Load |
|----------|------|
| Full API details, all providers, advanced protocols | [llm-integration.md](references/llm-integration.md) |

Files in this skill

  • SKILL.md3.3 KB
  • references/llm-integration.md4.4 KB
  • scripts/deps.openai-like.ini82 B
  • scripts/deps.openai.ini77 B
  • scripts/deps.vllm.ini75 B
  • scripts/install-deps.sh13.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.