feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX, enhanced with LiteLLM integration to support 100+ LLM providers through a unified API. ## Major Changes ### Phase 1: Repository & Infrastructure Setup - Established new repository structure and branching strategy - Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md) - Set up development environment and tooling configuration ### Phase 2: Rust Workspace Transformation - Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates) - Updated package names, binary names, and workspace members - Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs - Updated all internal references, imports, and type names - Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/ - Fixed all Rust compilation errors after mass rename ### Phase 3: LiteLLM Integration - Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.) - Implemented OpenAI-compatible Chat Completions API support - Added model family detection and provider-specific handling - Updated authentication to support LiteLLM API keys - Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL - Added LLMX_API_KEY for unified authentication - Enhanced error handling for Chat Completions API responses - Implemented fallback mechanisms between Responses API and Chat Completions API ### Phase 4: TypeScript/Node.js Components - Renamed npm package: @codex/codex-cli → @valknar/llmx - Updated TypeScript SDK to use new LLMX APIs and endpoints - Fixed all TypeScript compilation and linting errors - Updated SDK tests to support both API backends - Enhanced mock server to handle multiple API formats - Updated build scripts for cross-platform packaging ### Phase 5: Configuration & Documentation - Updated all configuration files to use LLMX naming - Rewrote README and documentation for LLMX branding - Updated config paths: ~/.codex/ → ~/.llmx/ - Added comprehensive LiteLLM setup guide - Updated all user-facing strings and help text - Created release plan and migration documentation ### Phase 6: Testing & Validation - Fixed all Rust tests for new naming scheme - Updated snapshot tests in TUI (36 frame files) - Fixed authentication storage tests - Updated Chat Completions payload and SSE tests - Fixed SDK tests for new API endpoints - Ensured compatibility with Claude Sonnet 4.5 model - Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL) ### Phase 7: Build & Release Pipeline - Updated GitHub Actions workflows for LLMX binary names - Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/ - Updated CI/CD pipelines for new package names - Made Apple code signing optional in release workflow - Enhanced npm packaging resilience for partial platform builds - Added Windows sandbox support to workspace - Updated dotslash configuration for new binary names ### Phase 8: Final Polish - Renamed all assets (.github images, labels, templates) - Updated VSCode and DevContainer configurations - Fixed all clippy warnings and formatting issues - Applied cargo fmt and prettier formatting across codebase - Updated issue templates and pull request templates - Fixed all remaining UI text references ## Technical Details **Breaking Changes:** - Binary name changed from `codex` to `llmx` - Config directory changed from `~/.codex/` to `~/.llmx/` - Environment variables renamed (CODEX_* → LLMX_*) - npm package renamed to `@valknar/llmx` **New Features:** - Support for 100+ LLM providers via LiteLLM - Unified authentication with LLMX_API_KEY - Enhanced model provider detection and handling - Improved error handling and fallback mechanisms **Files Changed:** - 578 files modified across Rust, TypeScript, and documentation - 30+ Rust crates renamed and updated - Complete rebrand of UI, CLI, and documentation - All tests updated and passing **Dependencies:** - Updated Cargo.lock with new package names - Updated npm dependencies in llmx-cli - Enhanced OpenAPI models for LLMX backend This release establishes LLMX as a standalone project with comprehensive LiteLLM integration, maintaining full backward compatibility with existing functionality while opening support for a wide ecosystem of LLM providers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Sebastian Krüger <support@pivoine.art>
This commit is contained in:
26
llmx-rs/stdio-to-uds/Cargo.toml
Normal file
26
llmx-rs/stdio-to-uds/Cargo.toml
Normal file
@@ -0,0 +1,26 @@
|
||||
[package]
|
||||
edition = "2024"
|
||||
name = "llmx-stdio-to-uds"
|
||||
version = { workspace = true }
|
||||
|
||||
[[bin]]
|
||||
name = "llmx-stdio-to-uds"
|
||||
path = "src/main.rs"
|
||||
|
||||
[lib]
|
||||
name = "llmx_stdio_to_uds"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow = { workspace = true }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
uds_windows = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
assert_cmd = { workspace = true }
|
||||
pretty_assertions = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
20
llmx-rs/stdio-to-uds/README.md
Normal file
20
llmx-rs/stdio-to-uds/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# llmx-stdio-to-uds
|
||||
|
||||
Traditionally, there are two transport mechanisms for an MCP server: stdio and HTTP.
|
||||
|
||||
This crate helps enable a third, which is UNIX domain socket, because it has the advantages that:
|
||||
|
||||
- The UDS can be attached to long-running process, like an HTTP server.
|
||||
- The UDS can leverage UNIX file permissions to restrict access.
|
||||
|
||||
To that end, this crate provides an adapter between a UDS and stdio. The idea is that someone could start an MCP server that communicates over `/tmp/mcp.sock`. Then the user could specify this on the fly like so:
|
||||
|
||||
```
|
||||
llmx --config mcp_servers.example={command="llmx-stdio-to-uds",args=["/tmp/mcp.sock"]}
|
||||
```
|
||||
|
||||
Unfortunately, the Rust standard library does not provide support for UNIX domain sockets on Windows today even though support was added in October 2018 in Windows 10:
|
||||
|
||||
https://github.com/rust-lang/rust/issues/56533
|
||||
|
||||
As a workaround, this crate leverages https://crates.io/crates/uds_windows as a dependency on Windows.
|
||||
52
llmx-rs/stdio-to-uds/src/lib.rs
Normal file
52
llmx-rs/stdio-to-uds/src/lib.rs
Normal file
@@ -0,0 +1,52 @@
|
||||
#![deny(clippy::print_stdout)]
|
||||
|
||||
use std::io;
|
||||
use std::io::Write;
|
||||
use std::net::Shutdown;
|
||||
use std::path::Path;
|
||||
use std::thread;
|
||||
|
||||
use anyhow::Context;
|
||||
use anyhow::anyhow;
|
||||
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::net::UnixStream;
|
||||
|
||||
#[cfg(windows)]
|
||||
use uds_windows::UnixStream;
|
||||
|
||||
/// Connects to the Unix Domain Socket at `socket_path` and relays data between
|
||||
/// standard input/output and the socket.
|
||||
pub fn run(socket_path: &Path) -> anyhow::Result<()> {
|
||||
let mut stream = UnixStream::connect(socket_path)
|
||||
.with_context(|| format!("failed to connect to socket at {}", socket_path.display()))?;
|
||||
|
||||
let mut reader = stream
|
||||
.try_clone()
|
||||
.context("failed to clone socket for reading")?;
|
||||
|
||||
let stdout_thread = thread::spawn(move || -> io::Result<()> {
|
||||
let stdout = io::stdout();
|
||||
let mut handle = stdout.lock();
|
||||
io::copy(&mut reader, &mut handle)?;
|
||||
handle.flush()?;
|
||||
Ok(())
|
||||
});
|
||||
|
||||
let stdin = io::stdin();
|
||||
{
|
||||
let mut handle = stdin.lock();
|
||||
io::copy(&mut handle, &mut stream).context("failed to copy data from stdin to socket")?;
|
||||
}
|
||||
|
||||
stream
|
||||
.shutdown(Shutdown::Write)
|
||||
.context("failed to shutdown socket writer")?;
|
||||
|
||||
let stdout_result = stdout_thread
|
||||
.join()
|
||||
.map_err(|_| anyhow!("thread panicked while copying socket data to stdout"))?;
|
||||
stdout_result.context("failed to copy data from socket to stdout")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
19
llmx-rs/stdio-to-uds/src/main.rs
Normal file
19
llmx-rs/stdio-to-uds/src/main.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
use std::process;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let mut args = env::args_os().skip(1);
|
||||
let Some(socket_path) = args.next() else {
|
||||
eprintln!("Usage: llmx-stdio-to-uds <socket-path>");
|
||||
process::exit(1);
|
||||
};
|
||||
|
||||
if args.next().is_some() {
|
||||
eprintln!("Expected exactly one argument: <socket-path>");
|
||||
process::exit(1);
|
||||
}
|
||||
|
||||
let socket_path = PathBuf::from(socket_path);
|
||||
llmx_stdio_to_uds::run(&socket_path)
|
||||
}
|
||||
68
llmx-rs/stdio-to-uds/tests/stdio_to_uds.rs
Normal file
68
llmx-rs/stdio-to-uds/tests/stdio_to_uds.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
use std::io::ErrorKind;
|
||||
use std::io::Read;
|
||||
use std::io::Write;
|
||||
use std::sync::mpsc;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Context;
|
||||
use assert_cmd::Command;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::net::UnixListener;
|
||||
|
||||
#[cfg(windows)]
|
||||
use uds_windows::UnixListener;
|
||||
|
||||
#[test]
|
||||
fn pipes_stdin_and_stdout_through_socket() -> anyhow::Result<()> {
|
||||
let dir = tempfile::TempDir::new().context("failed to create temp dir")?;
|
||||
let socket_path = dir.path().join("socket");
|
||||
let listener = match UnixListener::bind(&socket_path) {
|
||||
Ok(listener) => listener,
|
||||
Err(err) if err.kind() == ErrorKind::PermissionDenied => {
|
||||
eprintln!("skipping test: failed to bind unix socket: {err}");
|
||||
return Ok(());
|
||||
}
|
||||
Err(err) => {
|
||||
return Err(err).context("failed to bind test unix socket");
|
||||
}
|
||||
};
|
||||
|
||||
let (tx, rx) = mpsc::channel();
|
||||
let server_thread = thread::spawn(move || -> anyhow::Result<()> {
|
||||
let (mut connection, _) = listener
|
||||
.accept()
|
||||
.context("failed to accept test connection")?;
|
||||
let mut received = Vec::new();
|
||||
connection
|
||||
.read_to_end(&mut received)
|
||||
.context("failed to read data from client")?;
|
||||
tx.send(received)
|
||||
.map_err(|_| anyhow::anyhow!("failed to send received bytes to test thread"))?;
|
||||
connection
|
||||
.write_all(b"response")
|
||||
.context("failed to write response to client")?;
|
||||
Ok(())
|
||||
});
|
||||
|
||||
Command::cargo_bin("llmx-stdio-to-uds")?
|
||||
.arg(&socket_path)
|
||||
.write_stdin("request")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("response");
|
||||
|
||||
let received = rx
|
||||
.recv_timeout(Duration::from_secs(1))
|
||||
.context("server did not receive data in time")?;
|
||||
assert_eq!(received, b"request");
|
||||
|
||||
let server_result = server_thread
|
||||
.join()
|
||||
.map_err(|_| anyhow::anyhow!("server thread panicked"))?;
|
||||
server_result.context("server failed")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user