
Research
/Security News
Popular Go Decimal Library Targeted by Long-Running Typosquat with DNS Backdoor
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.
@jutech-devs/universal-ai
Advanced tools
Universal AI SDK supporting multiple providers like OpenAI, Anthropic, Google, and more
A unified SDK for interacting with ALL major AI providers with React hooks support.
gpt-4o, gpt-4o-mini, o1-preview, o1-minigpt-4-turbo, gpt-4, gpt-4-32kgpt-3.5-turbo, gpt-3.5-turbo-16ktext-davinci-003, code-davinci-002claude-3-5-sonnet-20241022, claude-3-5-haiku-20241022claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307claude-2.1, claude-2.0, claude-instant-1.2gemini-2.0-flash-expgemini-1.5-pro-002, gemini-1.5-pro, gemini-1.5-flash-002, gemini-1.5-flash, gemini-1.5-flash-8bgemini-pro, gemini-pro-vision, gemini-ultrallama-3.3-70b-versatilellama-3.2-90b-text-preview, llama-3.2-11b-text-previewllama-3.1-70b-versatile, llama-3.1-8b-instantmixtral-8x7b-32768gemma2-9b-it, gemma-7b-itcommand-r-plus, command-rcommand, command-nightly, command-lightmistral-large-latest, mistral-large-2407mistral-medium-latest, mistral-small-latestopen-mistral-7b, open-mixtral-8x7b, open-mixtral-8x22bcodestral-latest, codestral-2405grok-beta, grok-vision-betadeepseek-chat, deepseek-coder, deepseek-reasonerconst ai = new UniversalAI(config);
// Chat completion
const response = await ai.chat(messages);
// Streaming
for await (const chunk of ai.stream(messages)) {
console.log(chunk.content);
}
// Get available models
const models = ai.getModels();
// Update configuration
ai.updateConfig({ temperature: 0.8 });
const {
messages, // Array of chat messages
isLoading, // Loading state
error, // Error message
response, // Last AI response
sendMessage, // Function to send a message
clearMessages, // Function to clear chat history
updateConfig, // Function to update AI config
models, // Available models for current provider
} = useAI(config);
const {
messages, // Array of chat messages
streamingContent, // Current streaming content
isLoading, // Loading state
error, // Error message
sendMessage, // Function to send a message
clearMessages, // Function to clear chat history
models, // Available models
} = useAIStream(config);
interface UniversalAIConfig {
provider: 'openai' | 'anthropic' | 'google';
apiKey: string;
model: string;
temperature?: number; // 0-1, default: 0.7
maxTokens?: number; // Max response tokens
topP?: number; // 0-1, nucleus sampling
baseURL?: string; // Custom API endpoint
}
import { UniversalAI } from '@jutech-devs/universal-ai';
// OpenAI
const openai = new UniversalAI({
provider: 'openai',
apiKey: process.env.OPENAI_API_KEY!,
model: 'gpt-4',
});
// Anthropic
const claude = new UniversalAI({
provider: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY!,
model: 'claude-3-5-sonnet-20241022',
});
// Google
const gemini = new UniversalAI({
provider: 'google',
apiKey: process.env.GOOGLE_API_KEY!,
model: 'gemini-1.5-pro',
});
const messages = [
{ role: 'user', content: 'Explain quantum computing' }
];
const [openaiResponse, claudeResponse, geminiResponse] = await Promise.all([
openai.chat(messages),
claude.chat(messages),
gemini.chat(messages),
]);
import { createSystemMessage, createUserMessage } from '@jutech-devs/universal-ai';
const messages = [
createSystemMessage('You are a helpful coding assistant.'),
createUserMessage('How do I create a React component?'),
];
const response = await ai.chat(messages);
const response = await ai.chat(messages);
if (response.usage) {
console.log(`Tokens used: ${response.usage.totalTokens}`);
console.log(`Prompt tokens: ${response.usage.promptTokens}`);
console.log(`Completion tokens: ${response.usage.completionTokens}`);
}
MIT © JuTech Devs
FAQs
Universal AI SDK supporting multiple providers like OpenAI, Anthropic, Google, and more
We found that @jutech-devs/universal-ai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.