Use mesh-llm serve/client subcommands (#8451)
Signed-off-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
@@ -12,7 +12,12 @@ import {
|
|||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { Button } from '../../ui/button';
|
import { Button } from '../../ui/button';
|
||||||
import { Input } from '../../ui/input';
|
import { Input } from '../../ui/input';
|
||||||
import { setConfigProvider, updateCustomProvider, createCustomProvider, getCustomProvider } from '../../../api';
|
import {
|
||||||
|
setConfigProvider,
|
||||||
|
updateCustomProvider,
|
||||||
|
createCustomProvider,
|
||||||
|
getCustomProvider,
|
||||||
|
} from '../../../api';
|
||||||
import { useModelAndProvider } from '../../ModelAndProviderContext';
|
import { useModelAndProvider } from '../../ModelAndProviderContext';
|
||||||
const MESH_API_PORT = 9337;
|
const MESH_API_PORT = 9337;
|
||||||
const MESH_CONSOLE_PORT = 3131;
|
const MESH_CONSOLE_PORT = 3131;
|
||||||
@@ -119,9 +124,7 @@ export const MeshSettings = () => {
|
|||||||
const body = meshProviderBody(modelList);
|
const body = meshProviderBody(modelList);
|
||||||
|
|
||||||
// Try the last-known provider ID first, then fall back to 'mesh'
|
// Try the last-known provider ID first, then fall back to 'mesh'
|
||||||
const idsToTry = meshProviderId === 'mesh'
|
const idsToTry = meshProviderId === 'mesh' ? ['mesh'] : [meshProviderId, 'mesh'];
|
||||||
? ['mesh']
|
|
||||||
: [meshProviderId, 'mesh'];
|
|
||||||
|
|
||||||
for (const id of idsToTry) {
|
for (const id of idsToTry) {
|
||||||
const existing = await getCustomProvider({ path: { id } });
|
const existing = await getCustomProvider({ path: { id } });
|
||||||
@@ -172,22 +175,24 @@ export const MeshSettings = () => {
|
|||||||
const args: string[] = [];
|
const args: string[] = [];
|
||||||
|
|
||||||
if (mode === 'new') {
|
if (mode === 'new') {
|
||||||
args.push('--model', selectedModel);
|
args.push('serve', '--model', selectedModel);
|
||||||
} else if (mode === 'join') {
|
} else if (mode === 'join') {
|
||||||
if (!joinToken.trim()) {
|
if (!joinToken.trim()) {
|
||||||
setError('Paste an invite token to join a mesh');
|
setError('Paste an invite token to join a mesh');
|
||||||
setStatus('stopped');
|
setStatus('stopped');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
args.push('--join', joinToken.trim());
|
if (contributeGpu) {
|
||||||
if (!contributeGpu) {
|
args.push('serve', '--join', joinToken.trim());
|
||||||
args.push('--client');
|
} else {
|
||||||
|
args.push('client', '--join', joinToken.trim());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// auto
|
// auto
|
||||||
args.push('--auto');
|
if (contributeGpu) {
|
||||||
if (!contributeGpu) {
|
args.push('serve', '--auto');
|
||||||
args.push('--client');
|
} else {
|
||||||
|
args.push('client', '--auto');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,8 +343,8 @@ export const MeshSettings = () => {
|
|||||||
<div className="border border-border-subtle rounded-xl p-4 bg-background-default">
|
<div className="border border-border-subtle rounded-xl p-4 bg-background-default">
|
||||||
<p className="text-sm font-medium text-text-default">Get started</p>
|
<p className="text-sm font-medium text-text-default">Get started</p>
|
||||||
<p className="text-xs text-text-muted mt-1">
|
<p className="text-xs text-text-muted mt-1">
|
||||||
mesh-llm is not installed. Follow the install guide to set it up, or connect to
|
mesh-llm is not installed. Follow the install guide to set it up, or connect to a mesh
|
||||||
a mesh already running on this machine.
|
already running on this machine.
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center gap-2 mt-3">
|
<div className="flex items-center gap-2 mt-3">
|
||||||
<a href="https://docs.anarchai.org/" target="_blank" rel="noopener noreferrer">
|
<a href="https://docs.anarchai.org/" target="_blank" rel="noopener noreferrer">
|
||||||
@@ -635,7 +640,9 @@ export const MeshSettings = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs text-text-muted block">Console</label>
|
<label className="text-xs text-text-muted block">Console</label>
|
||||||
<code className="text-xs text-text-default">http://localhost:{MESH_CONSOLE_PORT}</code>
|
<code className="text-xs text-text-default">
|
||||||
|
http://localhost:{MESH_CONSOLE_PORT}
|
||||||
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user