Skip to content

Commit 6fed2f3

Browse files
Initial Release
1 parent d8e7c9e commit 6fed2f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+13524
-0
lines changed

.eslintrc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended"
10+
],
11+
"parser": "@typescript-eslint/parser",
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module"
15+
},
16+
"plugins": ["@typescript-eslint"],
17+
"rules": {
18+
"@typescript-eslint/no-explicit-any": "warn",
19+
"@typescript-eslint/no-unused-vars": [
20+
"warn",
21+
{
22+
"argsIgnorePattern": "^_",
23+
"varsIgnorePattern": "^_"
24+
}
25+
],
26+
"@typescript-eslint/no-var-requires": "off",
27+
"no-console": "off",
28+
"prefer-const": "warn"
29+
},
30+
"ignorePatterns": [
31+
"dist/",
32+
"node_modules/",
33+
"coverage/",
34+
"*.config.ts",
35+
"*.config.js"
36+
]
37+
}

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18, 20]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linting
30+
run: npm run lint
31+
32+
- name: Run type checking
33+
run: npm run typecheck
34+
35+
- name: Run tests with coverage
36+
run: npm run test:coverage
37+
38+
- name: Upload coverage reports to Codecov
39+
uses: codecov/codecov-action@v5
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
files: ./coverage/coverage-final.json
43+
flags: unittests
44+
name: codecov-umbrella
45+
fail_ci_if_error: false

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
dist/
3+
coverage/
4+
.env
5+
.env.local
6+
*.log
7+
.DS_Store

.npmignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
src/
2+
tests/
3+
examples/
4+
.github/
5+
tsconfig.json
6+
tsconfig.esm.json
7+
.eslintrc.json
8+
.prettierrc
9+
vitest.config.ts
10+
*.test.ts
11+
*.spec.ts
12+
.git
13+
.gitignore
14+
node_modules

CHANGELOG.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Changelog
2+
3+
## [1.1.0] - 2026-01-16
4+
5+
### Added
6+
7+
#### Universal Provider Support
8+
- **Generic Wrapper Factory**: Added `createClient()` function to create clients for any LLM provider using their official SDK
9+
- **OpenAI-Compatible Helper**: Added `createOpenAICompatible()` for easy integration with OpenAI-compatible providers
10+
- **15 New Provider Wrappers**: Pre-configured factory functions for all remaining providers:
11+
- `createGroq()` - Groq (fast inference)
12+
- `createDeepSeek()` - DeepSeek (reasoning models)
13+
- `createPerplexity()` - Perplexity (online models with search)
14+
- `createMistral()` - Mistral AI
15+
- `createOpenRouter()` - OpenRouter (access to 200+ models)
16+
- `createTogether()` - Together AI
17+
- `createXAI()` - xAI (Grok)
18+
- `createFireworks()` - Fireworks AI
19+
- `createAnyscale()` - Anyscale
20+
- `createHuggingFace()` - Hugging Face
21+
- `createGemini()` - Google Gemini
22+
- `createCohere()` - Cohere
23+
- `createAzure()` - Azure OpenAI
24+
- `createBedrock()` - AWS Bedrock
25+
- `createVertexAI()` - Google Vertex AI
26+
27+
#### Utility Functions
28+
- **`getProxyURL(provider)`**: Get the LockLLM proxy URL for any specific provider
29+
- **`getAllProxyURLs()`**: Get all available proxy URLs for all 17 providers
30+
- **Type Export**: Added `ProviderName` type export for better TypeScript support
31+
32+
#### Examples
33+
- **`examples/wrapper-generic.ts`**: Comprehensive example showing three ways to integrate with any provider
34+
- **`examples/wrapper-all-providers.ts`**: Complete example demonstrating all 17 providers
35+
36+
#### Documentation
37+
- Updated README with provider comparison table showing wrapper functions and compatibility
38+
- Added three integration methods with examples (provider-specific, generic, official SDKs)
39+
- Expanded "Supported Providers" section with detailed integration patterns
40+
- Added examples for Groq, DeepSeek, Mistral, Perplexity, OpenRouter, and Azure
41+
- Updated API Reference with all new wrapper functions and utilities
42+
- Enhanced examples README with new example descriptions
43+
44+
### Changed
45+
- Build system updated to properly generate both CommonJS (`.js`) and ESM (`.mjs`) outputs
46+
- Fixed `tsconfig.esm.json` to work with TypeScript 5.9.3
47+
- Improved documentation structure and clarity
48+
49+
### Technical Details
50+
51+
#### Integration Methods
52+
53+
**Method 1: Provider-Specific Wrappers (Easiest)**
54+
```typescript
55+
import { createOpenAI, createGroq, createAnthropic } from '@lockllm/sdk';
56+
const client = createGroq({ apiKey: process.env.LOCKLLM_API_KEY });
57+
```
58+
59+
**Method 2: Generic Wrappers (Flexible)**
60+
```typescript
61+
import { createClient, createOpenAICompatible } from '@lockllm/sdk';
62+
// For OpenAI-compatible providers
63+
const client = createOpenAICompatible('deepseek', { apiKey });
64+
// For custom SDKs
65+
const cohere = createClient('cohere', CohereClient, { apiKey });
66+
```
67+
68+
**Method 3: Official SDKs Directly (Most Control)**
69+
```typescript
70+
import OpenAI from 'openai';
71+
import { getProxyURL } from '@lockllm/sdk';
72+
const client = new OpenAI({
73+
apiKey: process.env.LOCKLLM_API_KEY,
74+
baseURL: getProxyURL('mistral')
75+
});
76+
```
77+
78+
### Notes
79+
- All 15+ providers are now fully supported with multiple integration options
80+
- Zero breaking changes - existing code continues to work
81+
- Backward compatible with v1.0.0

CODE_OF_CONDUCT.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
### Positive Behavior
12+
13+
Examples of behavior that contributes to a positive environment:
14+
15+
- Using welcoming and inclusive language
16+
- Being respectful of differing viewpoints and experiences
17+
- Gracefully accepting constructive criticism
18+
- Focusing on what is best for the community
19+
- Showing empathy towards other community members
20+
- Giving and gracefully accepting constructive feedback
21+
- Accepting responsibility and apologizing to those affected by our mistakes
22+
- Learning from mistakes and improving our behavior
23+
24+
### Unacceptable Behavior
25+
26+
Examples of unacceptable behavior include:
27+
28+
- The use of sexualized language or imagery
29+
- Trolling, insulting or derogatory comments, and personal or political attacks
30+
- Public or private harassment
31+
- Publishing others' private information without explicit permission
32+
- Violent threats or language directed against another person
33+
- Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language
34+
- Advocating for, or encouraging, any of the above behavior
35+
- Other conduct which could reasonably be considered inappropriate in a professional setting
36+
37+
## Scope
38+
39+
This Code of Conduct applies within all community spaces, including but not limited to:
40+
41+
- GitHub repositories (issues, pull requests, discussions)
42+
- Project communication channels (email, chat, forums)
43+
- Social media accounts representing the project
44+
- Project events (conferences, meetups, online events)
45+
46+
This Code of Conduct also applies when an individual is officially representing the community in public spaces.
47+
48+
## Enforcement Responsibilities
49+
50+
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior. They will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
51+
52+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct. They will communicate reasons for moderation decisions when appropriate.
53+
54+
## Reporting Issues
55+
56+
If you experience or witness unacceptable behavior, or have any other concerns, please report it by contacting the project team at:
57+
58+
**support@lockllm.com**
59+
60+
All reports will be handled with discretion and confidentiality.
61+
62+
### What to Include in Your Report
63+
64+
To help us address the issue effectively, please include:
65+
66+
- Your contact information
67+
- Names (real, nicknames, or pseudonyms) of individuals involved
68+
- Description of the incident, including specific behavior
69+
- Date and time of the incident
70+
- Location/platform where the incident occurred
71+
- Whether the incident is ongoing
72+
- Any additional context or information
73+
- If you believe any other individuals witnessed the incident
74+
75+
### Confidentiality
76+
77+
All reports will be reviewed and investigated. We respect the privacy and security of the reporter of any incident.
78+
79+
## Enforcement Guidelines
80+
81+
Project maintainers will follow these Community Impact Guidelines in determining consequences for any action deemed in violation of this Code of Conduct:
82+
83+
### 1. Correction
84+
85+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome.
86+
87+
**Consequence**: A private, written warning from project maintainers, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
88+
89+
### 2. Warning
90+
91+
**Community Impact**: A violation through a single incident or series of actions.
92+
93+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period. This includes avoiding interactions in community spaces as well as external channels. Violating these terms may lead to a temporary or permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
100+
101+
### 4. Permanent Ban
102+
103+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
104+
105+
**Consequence**: A permanent ban from any sort of public interaction within the community.
106+
107+
## Attribution
108+
109+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at
110+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
111+
112+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
113+
114+
[homepage]: https://www.contributor-covenant.org
115+
116+
For answers to common questions about this code of conduct, see the FAQ at
117+
https://www.contributor-covenant.org/faq. Translations are available at
118+
https://www.contributor-covenant.org/translations.
119+
120+
## Contact
121+
122+
- **Security Issues**: support@lockllm.com (see [SECURITY.md](SECURITY.md))
123+
124+
## Acknowledgment
125+
126+
By participating in this community, you agree to abide by this Code of Conduct. We are committed to providing a welcoming and inspiring community for all.
127+
128+
---
129+
130+
**Last Updated**: January 2026

0 commit comments

Comments
 (0)