# pricardok/litellm-pk architecture

> Architecture diagram of the GitHub repository pricardok/litellm-pk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pricardok/litellm-pk
- Repository: https://github.com/pricardok/litellm-pk

## Overview

Este repositório configura um gateway LiteLLM compatível com OpenAI: clientes como DSH e VS Code enviam solicitações à API, que oferece um pool com fallback e duas rotas diretas para DeepSeek. A configuração também documenta autenticação, chaves de provedores e persistência opcional; os scripts iniciam o proxy localmente e o Compose oferece execução em container. Como não há trechos de código-fonte, as relações abaixo se limitam ao que o README descreve explicitamente.

Main entry points: [`config.yaml`](https://github.com/pricardok/litellm-pk/blob/main/config.yaml) (smart-pool), [`README.md`](https://github.com/pricardok/litellm-pk/blob/main/README.md) (API OpenAI /v1), [`run.bat`](https://github.com/pricardok/litellm-pk/blob/main/run.bat) (Inicializador Windows), [`run.sh`](https://github.com/pricardok/litellm-pk/blob/main/run.sh) (Inicializador Linux)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Clientes"]
  node_dsh(("DSH"))
  node_vscode(("VS Code"))
end

subgraph group_gateway["Gateway e rotas"]
  node_proxy["LiteLLM Proxy"]
  node_api["API OpenAI /v1<br/>[README.md]"]
  node_smart["smart-pool<br/>[config.yaml]"]
  node_direct["deepseek-direct<br/>[config.yaml]"]
  node_reasoner["deepseek-reasoner<br/>[config.yaml]"]
  node_nvidia["NVIDIA NIM"]
  node_groq["Groq"]
  node_deepseek["DeepSeek"]
  node_admin["Painel e health<br/>[README.md]"]
end

subgraph group_operations["Execução e estado"]
  node_env["Variáveis e chaves<br/>[.env.example]"]
  node_windows["Inicializador Windows<br/>[run.bat]"]
  node_linux["Inicializador Linux<br/>[run.sh]"]
  node_compose["Deploy em container<br/>[docker-compose.yml]"]
  node_postgres[("PostgreSQL")]
end

node_dsh -->|"envia solicitações"| node_api
node_vscode -->|"envia solicitações"| node_api
node_api -->|"atendido por"| node_proxy
node_proxy -->|"disponibiliza rota"| node_smart
node_proxy -->|"disponibiliza rota"| node_direct
node_proxy -->|"disponibiliza rota"| node_reasoner
node_smart -->|"tenta primeiro"| node_nvidia
node_smart -->|"fallback"| node_groq
node_smart -->|"fallback"| node_deepseek
node_direct -->|"roteia diretamente"| node_deepseek
node_reasoner -->|"roteia ao reasoner"| node_deepseek
node_proxy -->|"expõe interface"| node_admin
node_windows -->|"carrega variáveis"| node_env
node_windows -->|"inicia com config"| node_proxy
node_linux -->|"carrega variáveis"| node_env
node_linux -->|"inicia com config"| node_proxy
node_compose -->|"executa container"| node_proxy
node_proxy -.->|"persiste opcionalmente"| node_postgres

click node_api "https://github.com/pricardok/litellm-pk/blob/main/README.md"
click node_smart "https://github.com/pricardok/litellm-pk/blob/main/config.yaml"
click node_direct "https://github.com/pricardok/litellm-pk/blob/main/config.yaml"
click node_reasoner "https://github.com/pricardok/litellm-pk/blob/main/config.yaml"
click node_admin "https://github.com/pricardok/litellm-pk/blob/main/README.md"
click node_env "https://github.com/pricardok/litellm-pk/blob/main/.env.example"
click node_windows "https://github.com/pricardok/litellm-pk/blob/main/run.bat"
click node_linux "https://github.com/pricardok/litellm-pk/blob/main/run.sh"
click node_compose "https://github.com/pricardok/litellm-pk/blob/main/docker-compose.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dsh,node_vscode toneBlue
class node_proxy,node_api,node_smart,node_direct,node_reasoner,node_nvidia,node_groq,node_deepseek,node_admin toneAmber
class node_env,node_windows,node_linux,node_compose,node_postgres toneMint
```

## Components

### Clientes

- **DSH**
- **VS Code**

### Gateway e rotas

- **LiteLLM Proxy**
- [API OpenAI /v1](https://github.com/pricardok/litellm-pk/blob/main/README.md): `README.md`
- [smart-pool](https://github.com/pricardok/litellm-pk/blob/main/config.yaml): `config.yaml`
- [deepseek-direct](https://github.com/pricardok/litellm-pk/blob/main/config.yaml): `config.yaml`
- [deepseek-reasoner](https://github.com/pricardok/litellm-pk/blob/main/config.yaml): `config.yaml`
- **NVIDIA NIM**
- **Groq**
- **DeepSeek**
- [Painel e health](https://github.com/pricardok/litellm-pk/blob/main/README.md): `README.md`

### Execução e estado

- [Variáveis e chaves](https://github.com/pricardok/litellm-pk/blob/main/.env.example): `.env.example`
- [Inicializador Windows](https://github.com/pricardok/litellm-pk/blob/main/run.bat): `run.bat`
- [Inicializador Linux](https://github.com/pricardok/litellm-pk/blob/main/run.sh): `run.sh`
- [Deploy em container](https://github.com/pricardok/litellm-pk/blob/main/docker-compose.yml): `docker-compose.yml`
- **PostgreSQL**

## Connections

- DSH → API OpenAI /v1: envia solicitações (evidence: `README.md`)
- VS Code → API OpenAI /v1: envia solicitações (evidence: `README.md`)
- API OpenAI /v1 → LiteLLM Proxy: atendido por (evidence: `README.md`)
- LiteLLM Proxy → smart-pool: disponibiliza rota (evidence: `README.md`)
- LiteLLM Proxy → deepseek-direct: disponibiliza rota (evidence: `README.md`)
- LiteLLM Proxy → deepseek-reasoner: disponibiliza rota (evidence: `README.md`)
- smart-pool → NVIDIA NIM: tenta primeiro (evidence: `README.md`)
- smart-pool → Groq: fallback (evidence: `README.md`)
- smart-pool → DeepSeek: fallback (evidence: `README.md`)
- deepseek-direct → DeepSeek: roteia diretamente (evidence: `README.md`)
- deepseek-reasoner → DeepSeek: roteia ao reasoner (evidence: `README.md`)
- LiteLLM Proxy → Painel e health: expõe interface (evidence: `README.md`)
- Inicializador Windows → Variáveis e chaves: carrega variáveis (evidence: `README.md`)
- Inicializador Windows → LiteLLM Proxy: inicia com config (evidence: `README.md`)
- Inicializador Linux → Variáveis e chaves: carrega variáveis (evidence: `README.md`)
- Inicializador Linux → LiteLLM Proxy: inicia com config (evidence: `README.md`)
- Deploy em container → LiteLLM Proxy: executa container (evidence: `README.md`)
- LiteLLM Proxy → PostgreSQL: persiste opcionalmente (evidence: `README.md`)
