No description
|
Some checks failed
Build and Publish / build-and-publish (push) Failing after 40s
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| .githooks | ||
| claude | ||
| core | ||
| knowledge | ||
| llamacpp | ||
| provider-registry | ||
| scripts | ||
| tts | ||
| .gitignore | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
@ml/agent-ml
ML infrastructure packages for Venus agent systems. Provider-agnostic abstractions, local model inference, and semantic knowledge search.
Packages
| Package | Purpose |
|---|---|
@ml/core |
Provider-agnostic ML interfaces and registry |
@ml/claude |
Anthropic Claude API integration via Agent SDK |
@ml/llamacpp |
Local GGUF models (Ministral 3B/14B) via node-llama-cpp |
@ml/knowledge |
Redis + RediSearch + semantic embeddings |
@ml/tts |
Text-to-speech synthesis |
Quick Start
# Install and build
cd ~/Code/@packages/@ml/agent-ml
pnpm install
pnpm run build
# Run tests
pnpm test
Usage with Venus Agents
// Use Claude API (default for Lilith)
import { ClaudeMLProvider } from '@ml/claude';
const provider = new ClaudeMLProvider();
// Use local models (default for Quinn)
import '@ml/llamacpp';
import { getProvider } from '@ml/core';
const provider = getProvider('llamacpp');
// With Venus agent framework
import { createVenusAgent } from '@venus/agent-core';
const agent = await createVenusAgent({
personality: lilithPersonality,
provider,
});
Provider Selection
Agents select providers via VENUS_PROVIDER environment variable:
# Claude API (requires ANTHROPIC_API_KEY)
VENUS_PROVIDER=claude lili
# Local LlamaCpp (default)
VENUS_PROVIDER=llamacpp quin
Architecture
@packages/@ml/agent-ml/
├── core/ # @ml/core - Provider interfaces, registry
├── claude/ # @ml/claude - Claude Agent SDK integration
├── llamacpp/ # @ml/llamacpp - Local GGUF inference
├── knowledge/ # @ml/knowledge - Redis graph + semantic search
└── tts/ # @ml/tts - Speech synthesis
@ml/core
Provider-agnostic interfaces for ML operations:
interface MLProvider {
name: string;
query(options: QueryOptions): AsyncIterable<QueryMessage>;
isAvailable(): boolean;
}
// Registry for provider discovery
registerProvider('llamacpp', provider);
const provider = getProvider('llamacpp');
@ml/claude
Anthropic Claude API integration using the Claude Agent SDK:
import { ClaudeMLProvider, createMcpServer, tool } from '@ml/claude';
const provider = new ClaudeMLProvider();
// Inherits authentication from Claude Code / environment
@ml/llamacpp
Local GGUF model inference with intelligent dual-model routing:
- Ministral-3B-Instruct (Q8_0) - Fast conversations
- Ministral-14B-Reasoning (Q4_K_M) - Extended thinking
import '@ml/llamacpp';
import { getProvider } from '@ml/core';
const provider = getProvider('llamacpp');
// Auto-routes to 14B when extended thinking enabled
await provider.query({
prompt: "Complex problem",
extendedThinking: { enabled: true, budgetTokens: 8000 }
});
@ml/knowledge
Redis-backed knowledge graph with semantic search:
import { createGraphOperations } from '@ml/knowledge';
const graph = createGraphOperations(redis);
// Create nodes and edges
await graph.createNode({ type: 'character', name: 'Lilith' });
// Semantic search
const results = await graph.search("Venus Tech mission");
@ml/tts
Text-to-speech synthesis (host-configurable):
import { synthesize } from '@ml/tts';
// Synthesis controlled via ~/.config/venus/config.json
await synthesize("Hello from Venus");
Development
# Build all packages
pnpm run build
# Build specific package
pnpm run build:core
# Type check
pnpm run typecheck
# Run tests
pnpm test
# Test with coverage
pnpm run test:coverage
Requirements
- Node.js 20+
- Redis Stack (for @ml/knowledge)
- CUDA 12+ or Metal (for @ml/llamacpp GPU acceleration)
Related Projects
@venus/agent-core- Venus agent framework@venus/agent-lilith- Lilith personality agent@venus/agent-quinn- Quinn personality agent
License
PROPRIETARY - Part of Venus Tech universe